I tried to run an application on nodejs in Android using Termux. When I start npm , it said could not locate the bindings file. My device is rooted.
nodejs v10.15.3
npm 6.4.1
/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/bindings/bindings.js:91
throw err
^
Error: Could not locate the bindings file. Tried:
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/build/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/build/Debug/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/build/Release/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/out/Debug/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/Debug/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/out/Release/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/Release/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/build/default/binding.node
→/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/compiled/10.15.3/android/arm64/binding.node
at bindings (/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/bindings/bindings.js:88:9)
at Object.<anonymous> (/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ref/lib/ref.js:5:47)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/data/data/com.termux/files/home/IoT-blockchain-Std/node_modules/ffi/lib/ffi.js:6:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! IoT-blockchain-Std#1.0.0 start: `node build/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the IoT-blockchain-Std#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
How can I solve this issue?
I've solved the same issue installing the missing file.
In your case it is biding.node, so you should do: npm install binding
Related
I am new in Cordova and I want to use cordova Push Notification. Can anyone help me to use the plugin. It shows an error :
Error: Failed to fetch plugin https://github.com/zckrs/cordova-plugin-android-support-v4.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm WARN package.json helloworld#1.0.0 No repository field.
npm WARN package.json helloworld#1.0.0 No README data
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ENOGIT
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! Please include the following file with any support request:
npm ERR! D:\ExerciseApp\node_modules\npm-debug.log
You should use phonegap-plugin-push.
https://github.com/zckrs/cordova-plugin-android-support-v4.git is a plugin to add Android Support v4 client library not Push Notifications.
You can add the phonegap-plugin-push by typing the following in cmd -
cordova plugin add phonegap-plugin-push
or
cordova plugin add https://github.com/phonegap/phonegap-plugin-push
Quick Example -
document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady(){
var push = PushNotification.init({ "android": {"senderID": "91254247XXXX"}}); //add your sender ID from Firebase Cloud Messenging
push.on('registration', function(data) {
console.log(data.registrationId);
//document.getElementById("gcm_id").innerHTML = data.registrationId;
});
push.on('notification', function(data) {
alert("On Notification function!!");
// data.message,
// data.title,
// data.count,
// data.sound,
// data.image,
// data.additionalData
console.log("notification event");
console.log(JSON.stringify(data));
alert(JSON.stringify(data));
//Do something
});
push.on('error', function(e) {
alert(e);
});
}
Note - You need to add your app to Firebase Cloud Messenging for android platform and get your Sender ID from Firebase Console->Setting->Cloud Messenging Tab.
i have my first app here in github:
https://github.com/eshk12/firstApp
i'm trying to build it to APK file, but it failed.
i have install android sdk, and add android platform to the project.
but i get those error, i have no clue what the problem.
D:\ionic\firstApp>Ionic build android --v2 >> log.txt
[17:17:14] Error: Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:905:40
[17:17:14] Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14] Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:1200:43
[17:17:14] Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14] Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:1215:72
[17:17:14] Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14] ngc failed
[17:17:14] ionic-app-script task: "build"
[17:17:14] Error: Error
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-app-base# build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-app-base# build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-app-base package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-app-base
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-app-base
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\ionic\firstApp\npm-debug.log
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
thx for your help
In your view you're using a property called selectCurrencyInput
<ion-select okText="אשר" cancelText="בטל" [(ngModel)]="selectCurrencyInput">
but it's not declared in your component code.
#Component({
selector: 'currency-page',
templateUrl: 'currency.html',
providers: [NetworkServices]
})
export class CurrencyPage {
public load: any;
public results: any;
public amount: any;
public keys: any;
public selectCurrencyInput: string; // <- add this property to fix the issue
constructor(public networkServices: NetworkServices) {
this.load = false;
}
// ...
}
I am following this tutorial in installing phonegap. My computer is Windows 7 64 bit.
However when I run npm install -g phonegap in step 4 of the above tutorial, I am getting errors. The errors displayed in CMD are below
> ws#0.4.31 install C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\nod
e_modules\connect-phonegap\node_modules\socket.io\node_modules\engine.io\node_mo
dules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
/
C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-ph
onegap\node_modules\socket.io\node_modules\engine.io\node_modules\ws>if not defi
ned npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bi
n\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (no
de rebuild )
> ws#0.4.31 install C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\nod
e_modules\connect-phonegap\node_modules\socket.io\node_modules\socket.io-client\
node_modules\engine.io-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
|
C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-ph
onegap\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.
io-client\node_modules\ws>if not defined npm_config_node_gyp (node "C:\Program F
iles (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp
\bin\node-gyp.js" rebuild ) else (node rebuild )
^CTerminate batch job (Y/N)? y
The builderror.log file contains the below information.
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Yohan\AppData\Roaming\npm\node_modules\phonegap\node_modules\connect-phonegap\node_modules\socket.io\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
How can I fix this issue and install phonegap properly?
If possible Try reinstalling node.js with current stable version.
and then in your command prompt
npm install -g phonegap#latest
GoodLuck
I am trying to follow the instructions for "Getting started with react-native".
I know that using windows for my development platform is experimental but this is what I am doing. I start a "Node.js command prompt" then do ...
> npm install -g react-native-cli
> react-native init AwesomeProject
... but I get this error ...
C:\Users\plankton>react-native init AwesomeProject
This will walk you through creating a new React Native project in C:\Users\plankton\AwesomeProject
Installing react-native package from npm...
> bufferutil#1.2.1 install C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
bufferutil.cc
win_delay_load_hook.c
Creating library C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.lib and object C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\bufferutil\build\Release\\bufferutil.node
> utf-8-validate#1.2.1 install C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
validation.cc
win_delay_load_hook.c
Creating library C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.lib and object C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.exp
Generating code
Finished generating code
validation.vcxproj -> C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\ws\node_modules\utf-8-validate\build\Release\\validation.node
> spawn-sync#1.0.13 postinstall C:\Users\plankton\AwesomeProject\node_modules\react-native\node_modules\yeoman-generator\node_modules\cross-spawn\node_modules\spawn-sync
> node postinstall
npm WARN optional dep failed, continuing fsevents#1.0.6
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "react-native"
npm ERR! node v4.2.3
npm ERR! npm v2.14.7
npm ERR! path C:\Users\plankton\AppData\Roaming\npm-cache\brace-expansion\1.1.2\package\package.json.9d769f6c66df6b0ff357401140ec21e2
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\plankton\AppData\Roaming\npm-cache\brace-expansion\1.1.2\package\package.json.9d769f6c66df6b0ff357401140ec21e2' -> 'C:\Users\plankton\AppData\Roaming\npm-cache\brace-expansion\1.1.2\package\package.json'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename 'C:\Users\plankton\AppData\Roaming\npm-cache\brace-expansion\1.1.2\package\package.json.9d769f6c66df6b0ff357401140ec21e2' -> 'C:\Users\plankton\AppData\Roaming\npm-cache\brace-expansion\1.1.2\package\package.json']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\plankton\\AppData\\Roaming\\npm-cache\\brace-expansion\\1.1.2\\package\\package.json.9d769f6c66df6b0ff357401140ec21e2',
npm ERR! dest: 'C:\\Users\\plankton\\AppData\\Roaming\\npm-cache\\brace-expansion\\1.1.2\\package\\package.json',
npm ERR! parent: 'minimatch' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\plankton\AwesomeProject\npm-debug.log
`npm install --save react-native` failed
The error output suggest: Please try running this command again as root/Administrator., but how do I do that on a Windows 10 system?
UPDATE: Thank Louy your answer works. Here's a screen shot of what I ended up doing ...
Right click the Node.js command promtpt and select Run as Administrator.
UPDATE II: On subsequent iterations I got the same error. I what I had to do then was what Louy said to do in the comment:
delete the folder "C:\\Users\\plankton\\AppData\\Roaming\\npm-cache
UPDATE III:
I had run my Node.js command prompt as Administrator and I had deleted the folder "C:\\Users\\plankton\\AppData\\Roaming\\npm-cache and yet I still got the running this command again as root/Administrator error. I had to use Windows Explorer to unset the Read only and hidden properties off the "C:\Users\plankton\AppData` folder.
You need to start up your command line interpreter as an administrator.
Open start menu
Type "cmd"
Right click and choose "Run as Administrator"
Then do the same as you did earlier.
i have a source code of a mobile application written using phonegap and i want to build it to the Android (APK) and IOS versions, the source code is larger than that using phone gap online build service or XDK online build service so i tried to install phonegap and build my application using eclipse for android and xcode for ios.
i already have JDK, Android studio and i also configured all the needed configuration for JAVA, Android, Git in System Variable path key.
When i using command line to install phone gap like this "npm install -g phonegap" i have a lot of warnings and errors:
C:\Users\ahmed.marzouk>npm install -g phonegap
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit at Socket.<anonymous> (child_process.js:1183:11)
npm WARN addRemoteGit at Socket.emit (events.js:107:17)
npm WARN addRemoteGit at Pipe.close (net.js:485:12)
npm WARN addRemoteGit git+https://github.com/filmaj/node-plist.git resetting re
mote C:\Users\ahmed.marzouk\AppData\Roaming\npm-cache\_git-remotes\https-github-
com-filmaj-node-plist-git-653fe22e because of error: { [Error: Command failed: g
it -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit at Socket.<anonymous> (child_process.js:1183:11)
npm WARN addRemoteGit at Socket.emit (events.js:107:17)
npm WARN addRemoteGit at Pipe.close (net.js:485:12)
npm WARN addRemoteGit git+https://github.com/imhotep/plugman.git#0.5.7 resettin
g remote C:\Users\ahmed.marzouk\AppData\Roaming\npm-cache\_git-remotes\https-git
hub-com-imhotep-plugman-git-20c32d58 because of error: { [Error: Command failed:
git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm WARN engine ncallbacks#1.0.0: wanted: {"node":"~0.6.7"} (current: {"node":"0
.12.5","npm":"2.11.2"})
-
> cordova#2.7.4 install C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\
phonegap\node_modules\cordova
> node bootstrap.js
SUCCESS: Minimum requirements for blackberry met.
BOOTSTRAPPING blackberry...
WARNING: Your system does not meet requirements to create wp7 projects. See erro
r output below.
'C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap\node_modules\c
ordova\lib\cordova-wp7\bin\check_reqs' is not recognized as an internal or exter
nal command,
operable program or batch file.
SKIPPING wp7 bootstrap.
WARNING: Your system does not meet requirements to create ios projects. See erro
r output below.
Xcode is (probably) not installed, specifically the command `xcodebuild` is unav
ailable or erroring out. Output of `xcodebuild -version` is: 'xcodebuild' is not
recognized as an internal or external command,
operable program or batch file.
SKIPPING ios bootstrap.
WARNING: Your system does not meet requirements to create wp8 projects. See erro
r output below.
'C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap\node_modules\c
ordova\lib\cordova-wp7\bin\check_reqs' is not recognized as an internal or exter
nal command,
operable program or batch file.
SKIPPING wp8 bootstrap.
ERROR! Could not create a native blackberry project test fixture. See below for
error output.
Missing one of the following:
JDK: http://java.oracle.com
Apache ant: http://ant.apache.org
WARNING: Your system does not meet requirements to create android projects. See
error output below.
Please install Android target 17 (the Android 4.2 SDK). Make sure you have the l
atest Android tools installed as well. Run `android` from your command-line to i
nstall/update any missing SDKs or tools.
SKIPPING android bootstrap.
C:\Users\ahmed.marzouk\AppData\Roaming\npm\phonegap -> C:\Users\ahmed.marzouk\Ap
pData\Roaming\npm\node_modules\phonegap\bin\phonegap.js
phonegap#0.9.4 C:\Users\ahmed.marzouk\AppData\Roaming\npm\node_modules\phonegap
├── colors#0.6.2
├── semver#1.1.0
├── qrcode-terminal#0.9.5
├── shelljs#0.0.9
├── optimist#0.3.7 (wordwrap#0.0.3)
├── node-static#0.6.9 (mime#1.3.4)
├── phonegap-build#0.8.0 (qrcode-terminal#0.8.0, phonegap-build-api#0.3.3)
├── prompt#0.2.14 (pkginfo#0.3.0, revalidator#0.1.8, read#1.0.6, winston#0.8.3,
utile#0.2.1)
└── cordova#2.7.4 (ncallbacks#1.0.0, open#0.0.3, shelljs#0.1.2, elementtree#0.1.
3, request#2.11.4, xcode#0.5.1, prompt#0.2.7, plist#0.4.0, express#3.0.6, ripple
-emulator#0.9.29, plugman#0.5.6)
I need to know, is the phonegap installing correctly or not? and if not, how can i solve this issue?
Thanks
I found the solution.
First thing if you have any issue in git like 'git path not found' you should follow the instructions here: installing-git-in-path.
To solve the above problem you should:
first run your cmd as admin it will solve half of the problem.
If there are any issue related toAndroid SDK like
WARNING: Your system does not meet requirements to create android projects. See
error output below.
Please install Android target 17 (the Android 4.2 SDK).
in cmd >
android
then check Android 4.2 SDK and install it.
Thanks