Issue installing jhipster-uml - node.js

Using windows 10 when I run the command npm install -g jhipster-uml I have the following error:
C:\Users\Talon\AppData\Roaming\npm\jhipster-uml -> C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\jhipster-uml.js
> deasync#0.1.9 install C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync
> node ./build.js
C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
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 PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Talon\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! deasync#0.1.9 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deasync#0.1.9 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\Talon\AppData\Roaming\npm-cache\_logs\2018-01-11T14_51_34_388Z-debug.log
Googling around it seems to be a Windows issue with npm_config_node_gyp. I tried using npm cli to install other packages and it works, so it's most likely an issue with jhipster-uml.
I also tried using yarn to install it, I have a really similar error.

Can't find Python executable "python", you can set the PYTHON env variable.
You have to install python and restart the bash
If python is already installed, check if it's available in your PATH. If no, just add it.

Related

NPM can't install some packages

I have recently done a clean reformatting of my Windows PC, installed Atom, and Node.js and started by installing the package dualshock. I give it a minute and it fails with this error code:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Starb\node_modules\node-hid
gyp ERR! node -v v13.2.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN starb#1.0.0 No description
npm WARN starb#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid#0.5.7 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid#0.5.7 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\Starb\AppData\Roaming\npm-cache\_logs\2019-11-29T13_46_21_869Z-debug.log
I tried reinstalling gyp, Node, cleaning the cache, anything you can possibly imagine. i googled everywhere and couldnt find any solution that worked.
Full log from the console
If you use windows you are probably missing windows-build-tools
npm install --global --production windows-build-tools
Reference: https://github.com/nodejs/node-gyp

Can not install node-gyp

I can't install node-gyp in Windows 7. After many searches and trying many suggestions, I use (+), use npm install no-gyp-xml-stream. and in cmd (run as admin) this errors occurred:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\local-npm\node_modules\leveldo
wn
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown#1.7.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#1.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h.mohammdi\AppData\Roaming\npm-cache\_logs\2019-05-07T06_2
8_59_501Z-debug.log
I check to sure C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.0\Bin\MSBuild.exe is existed.
How can I install node-gyp to install local-npm? thanks...
From node-gyp documentation:
First install Microsoft's windows-build-tools using npm install --global --production windows-build-tools from PowerShell or CMD.exe (run as Administrator)
Install it globally using npm install -g node-gyp
You could use Node 11, not yet Node 12 as node-gyp will fail with v12

bitcoinjs-lib package and stack Error: Can't find Python executable on Windows with python 3.x.x

Trying to install the package bitcoinjs-lib I receive the following error:
> tiny-secp256k1#1.0.1 install C:\project\server\node_modules\tiny-secp256k1
> node-gyp rebuild
C:\project\server\node_modules\tiny-secp256k1>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 )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\myUser\AppData\Local\Programs\Python\Python36-32\python.EXE", you can set the PYTHON env variable .
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\project\server\node_modules\tiny-secp256k1
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN my_project#1.0.0 No description
npm WARN my_project#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tiny-secp256k1#1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tiny-secp256k1#1.0.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\myUser\AppData\Roaming\npm-cache\_logs\2018-11-07T01_26_57_441Z-debug.log
npm ERR! code ELIFECYCLE
57_470Z-debug.log
I went to node-gyp npm page: https://www.npmjs.com/package/node-gyp and I found that it does not support python v3.x.x
I researched and found some workarounds, however, all of them require actions by the user side and are tied to a particular OS.
I´m using Windows 7 (with Node v8.9.1) and python 3.6.4.
Is there a way to install the dependency and be able to share the package with other users (no matter OS or python version)?
Can anyone provide some kind of input?
I never went through this with a npm package so I´m really stuck and cannot find a proper solution.
Any help will be appreciated.

kafka-node module exception

I am trying to publish message to kafka broker from nodejs. when am trying to install kafka-node module in nodejs window. am getting exception related to python.
C:\Program Files\nodejs>npm install kafka-node
-
> snappy#4.1.2 install C:\Program Files\nodejs\node_modules\kafka-node\node_modules\snappy
> node-gyp rebuild
C:\Program Files\nodejs\node_modules\kafka-node\node_modules\snappy>if not defined npm_config_node_g
yp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin
\node-gyp.js" rebuild ) else (node rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.0, 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 failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-
gyp\lib\configure.js:121:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.j
s:110:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at maybeClose (internal/child_process.js:821:16)
gyp ERR! stack at Socket.<anonymous> (internal/child_process.js:319:11)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at Socket.emit (events.js:169:7)
gyp ERR! stack at Pipe._onclose (net.js:469:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm
\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\kafka-node\node_modules\snappy
gyp ERR! node -v v4.3.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\b
in\\npm-cli.js" "install" "kafka-node"
npm ERR! node v4.3.2
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! snappy#4.1.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the snappy#4.1.2 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the snappy 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 snappy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Program Files\nodejs\npm-debug.log
Is there any relation between kafka-node with python. I had setup python 3.4 and again tried to install kafka-node module, it says gyp is not suppported in python3.4 version . ( Below is error message )
So I installed python 2.6 and and again tried to install kafka-node again it is giving below error
C:\Program Files\nodejs\node_modules\kafka-node\node_modules\snappy>if not defined npm_config_node_g
yp (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.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) ins
tall the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of
the component to the system path if it is installed elsewhere. [C:\Program Files\nodejs\node_modul
es\kafka-node\node_modules\snappy\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit c
ode: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\nod
e-gyp\lib\build.js:270:23)
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 Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm
\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\kafka-node\node_modules\snappy
gyp ERR! node -v v4.3.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\b
in\\npm-cli.js" "install" "kafka-node"
npm ERR! node v4.3.2
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! snappy#4.1.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the snappy#4.1.2 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the snappy 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 snappy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Program Files\nodejs\npm-debug.log
Any help appreciated..Thanks
The error you revived on your second attempt is:
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) ins
tall the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of
the component to the system path if it is installed elsewhere.
Do you have Visual Studio with a C++ compiler installed? if not you should install it.
Other helpful answers can be found on this post :
Error in installing node.js module using npm
node-gyp is used to build the snappy dependency. A compression library. If you don't use compression in your kafka messages you can safely ignore this. This dependency was made optional in version 0.3.3.
If you don't use snappy you can just install the module with --no-optional flag:
npm install kafka-node --no-optional

Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable

bufferutil#1.2.1 install /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil > node-gyp rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok npm WARN install:bufferutil#1.2.1 bufferutil#1.2.1 install: node-gyp rebuild npm WARN install:bufferutil#1.2.1 Exit status 1 > utf-8-validate#1.2.1 install /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate > node-gyp rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok npm WARN install:utf-8-validate#1.2.1 utf-8-validate#1.2.1 install: node-gyp rebuild npm WARN install:utf-8-validate#1.2.1 Exit status 1
Scott Frees' solution didn't work for me but running
npm config set python $(which python)
did.
If you installed Python using a package manager, it should already be on your path- but if not: add it like this:
export PATH="$PATH:/usr/local/bin/python (or wherever you installed python to)
Node-gyp requires 2.x and cannot use Python3 (do you have the right version installed?).
See Running Python on Windows for Node.js dependencies for Windows to make sure you have your environment variable set.
I solved a similar error by upgrading the node-sass package to a version that is compatible with my installed Node version.
node-sass publishes a compatibility table that I found on their NPM page.

Resources