Installation failure in jdbc node package - node.js

I am a bit new to nodejs and I am trying to connect database via nodejs. For connecting I am installing the JDBC but it throws an error like below. Can you help for this?
C:\myDrive\work\samples\nodeapis\simpleapi>npm i --save jdbc
> java#0.9.1 install `enter code here`C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java
> node-gyp rebuild
C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java>if not defined npm_config_node_gyp (node "C:\myDrive\apps\node-v10.14.1-win-x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\myDrive\apps\node-v10.14.1-win-x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\myDrive\apps\Python\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\myDrive\\apps\\node-v10.14.1-win-x64\\node.exe" "C:\\myDrive\\apps\\node-v10.14.1-win-x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java
gyp ERR! node -v v10.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\myDrive\work\samples\nodeapis\simpleapi\package.json'
npm WARN simpleapi No description
npm WARN simpleapi No repository field.
npm WARN simpleapi No README data
npm WARN simpleapi No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java#0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.9.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2018-12-13T07_30_29_595Z-debug.log
After I have installed the lower version of python 2.7.0 this error has gone.
but the below error I got
C:\myDrive\work\samples\nodeapis\simpleapi>npm i --save jdbc
> java#0.9.1 install C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java
> node-gyp rebuild
C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java>if not defined npm_config_node_gyp (node "C:\myDrive\apps\node-v10.14.1-win-x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\myDrive\apps\node-v10.14.1-win-x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\myDrive\\apps\\node-v10.14.1-win-x64\\node.exe" "C:\\myDrive\\apps\\node-v10.14.1-win-x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\myDrive\work\samples\nodeapis\simpleapi\node_modules\java
gyp ERR! node -v v10.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\myDrive\work\samples\nodeapis\simpleapi\package.json'
npm WARN simpleapi No description
npm WARN simpleapi No repository field.
npm WARN simpleapi No README data
npm WARN simpleapi No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java#0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.9.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2018-12-13T08_15_21_567Z-debug.log
Thanks in advance

I think you need to install node-gyp and then try again, it is a cross-platform command line tool written in nodejs for compiling native addon modules.

Related

Error when installing web3 and ganache

This is the error I get when running npm install --save mocha ganache-cli web3#1.0.0-beta.26 :
rohitgoud$ npm install --save mocha ganache-cli web3#1.0.0-beta.26
> scrypt#6.0.3 preinstall /Users/rohitgoud/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: in `/Users/rohitgoud/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
> scrypt#6.0.3 install /Users/rohitgoud/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/anaconda3/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack at ChildProcess.exithandler (child_process.js:267:7)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:567:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rohitgoud/node_modules/scrypt
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/rohitgoud/package.json'
npm WARN webpack-cli#2.0.15 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rohitgoud No description
npm WARN rohitgoud No repository field.
npm WARN rohitgoud No README data
npm WARN rohitgoud No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rohitgoud/.npm/_logs/2018-04-26T01_45_43_548Z-debug.log
you need install python2.7(recommend)

Installation of npm package scrypt failing

I have nodejs ,npm and node-gyp installed on my machine . Also I have installed windows-build-tools as a prerequisite for scrypt package. But when I do a npm install scrypt , I get the following error. How to resolve this?
The complete error message is:-
$ npm install scrypt --save
> scrypt#6.0.3 preinstall C:\Users\Benyah\node_modules\scrypt
> node node-scrypt-preinstall.js
> scrypt#6.0.3 install C:\Users\Benyah\node_modules\scrypt
> node-gyp rebuild
C:\Users\Benyah\node_modules\scrypt>if not defined npm_config_node_gyp (node "C\Users\Benyah\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\nde-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node C:\Users\Benyah\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\ode-gyp.js" rebuild )
Warning: Missing input files:
C:\Users\Benyah\node_modules\scrypt\build\..\scrypt\win\include\config.h
Building the projects in this solution one at a time. To enable parallel build,please add the "/m" switch.
Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h
The system cannot find the file specified.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targts(356,5): error MSB6006: "CL.exe" exited with code -1073741701. [C:\Users\Benyh\node_modules\scrypt\build\copied_files.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targts(356,5): error MSB6006: "CL.exe" exited with code -1073741701. [C:\Users\Benyh\node_modules\scrypt\build\scrypt_wrapper.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` faied with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Benyah\AppData\Roaming\npm\ode_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces.js:198:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Benyah\\AppDta\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" rebuild"
gyp ERR! cwd C:\Users\Benyah\node_modules\scrypt
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Benyah\packag.json'
npm WARN Benyah No description
npm WARN Benyah No repository field.
npm WARN Benyah No README data
npm WARN Benyah No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional loging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Benyah\AppData\Roaming\npm-cache\_logs\2018-01-05T10_00_1_241Z-debug.log

Node Gyp Rebuild Error for Hubot-nagios4 node module

I am trying to install hubot-nagios4 module . Everytime i try installing with the command sudo npm install hubot-nagios4 --save i get the below error. I am currently using node version 6.9.1 and npm version 3.10.1.
unameit#Unameit:~/node/example2$ sudo npm install hubot-nagios4 --save
> contextify#0.1.15 install /home/unameit/node/example2/node_modules/contextify
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/unameit/.node-gyp/6.9.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/unameit/node/example2/node_modules/contextify/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:586:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)
gyp ERR! System Linux 3.13.0-74-generic
gyp ERR! command "/mnt/node/node-v6.9.1-linux-x86/bin/node" "/mnt/node/node-v6.9.1-linux-x86/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/unameit/node/example2/node_modules/contextify
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN example2#0.0.0 No repository field.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/mnt/node/node-v6.9.1-linux-x86/bin/node" "/usr/local/bin/npm" "install" "hubot-nagios4" "--save"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! contextify#0.1.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.15 install script 'node-gyp rebuild'.
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 contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs contextify
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/unameit/node/example2/npm-debug.log
Please assist

npm lzf module installation failure

I was trying to get the lzf module for my project, then an error occurred during the installation. Just as other people would have done I googled about the question, but couldn't find the right solution for my situation.
lzf#0.3.0 install /home/grewvr/node_modules/lzf
node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node- gyp/lib/configure.js:354:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-45-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/grewvr/node_modules/lzf
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN moskit#1.0.0 No repository field.
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "lzf"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! lzf#0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lzf#0.3.0 install script 'node-gyp rebuild'.
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 lzf package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs lzf
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls lzf
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/grewvr/npm-debug.log
Been trying to fix the problem for two days, please help me.

Error while installing the Atom editor

I have installed the nodejs-legacy, and it was no problem.
However, when I try do run script/build, I get the following error:
npm WARN prefer global npm#1.4.10 should be installed with -g
npm WARN package.json csslint#0.9.10 No README.md file found!
npm WARN package.json highlight.js#7.3.0 No README.md file found!
make: g++: Command not found
make: *** [Release/obj.target/runas/src/main.o] Error 127
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/atom/build/node_modules/runas
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! runas#0.5.4 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the runas#0.5.4 install script.
npm ERR! This is most likely a problem with the runas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls runas
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "--userconfig=/var/www/atom/.npmrc" "install" "--quiet"
npm ERR! cwd /var/www/atom/build
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm WARN prefer global grunt-cli#0.1.13 should be installed with -g
make: g++: Command not found
make: *** [Release/obj.target/dump_syms/deps/breakpad/src/common/dwarf/bytereader.o] Error 127
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/atom/build/node_modules/minidump
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm WARN package.json uid2#0.0.3 No README.md file found!
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/atom/build/npm-debug.log
npm ERR! not ok code 0
Does this error occour because I've installed nodejs-legacy? How should I do?
EDIT:
I've forgott to install g++, and when I try to run script/build, I get this looong message:
http://pastebin.com/vBpxrE7A
From your log it looks like node-gyp problem described here - I suggest paying special attention to this answer.
Generally people suggest reinstalling node-gyp (using repositories, npm or sources) and/or reverting to Python 2.6 - it seems that node-gyp depends on this Python version and reverting to 2.6 is the approach pointed out in answer I quoted above.
Well, I know it's late in SO terms (nearly two weeks!), but hope it will be of some use :)

Resources