trying to install bcrypt into node project + node set up issues - node.js

I have seen some very similar questions but none that I have found seem to work. I am trying to npm install bcrypt but i keep getting the error below.
bycrypt is the command that I use to install bcrypt modules. I do have Xcode and installing node-gyp does not seem to make a difference
regan#the-Voyagur buddha-bar (feature/styles) $ npm install --save bcrypt
npm WARN package.json mongo#0.1.0 No repository field.
npm WARN package.json mongo#0.1.0 No README data
-
> bcrypt#0.8.0 install /Users/regan/lighthouse/buddha-bar/node_modules/bcrypt
> node-gyp rebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/regan/lighthouse/buddha-bar/node_modules/bcrypt
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! bcrypt#0.8.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.8.0 install script.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "--save" "bcrypt"
npm ERR! cwd /Users/regan/lighthouse/buddha-bar
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
regan#the-Voyagur buddha-bar (feature/styles) $ xcode-select --print-path
/Library/Developer/CommandLineTools

OP managed to fix this for themselves with:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
but graciously accepted my answer anyway.
Original answer below:
There are two distinct problems here. One is that your node is slightly out of date and your npm is substantially out of date.
You're using OSX, so there are a number of popular ways to manage different node versions. Here's a guide on updating node https://github.com/npm/npm/wiki/Troubleshooting#updating-node-on-osx
Then you'll want to update to the latest npm:
npm install -g npm#latest
Finally, it looks like although you have XCode installed, something is still awry. You report that this command yields
$ xcode-select --print-path
/Library/Developer/CommandLineTools
On my system, which is OSX/Yosemite and can build native addon modules, I see
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
You may need to switch your xcode path to a different directory. For starters, though, please update to the current node and npm tools and try the installation again; if it still fails, the least dangerous next thing to try is
xcode-select --install
If none of that fixes things, let me know and I'll try to help further.

I was having a similar issue but with a different package.
node-gyp rebuild
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
Running macOS Catalina 10.15.2, I tried the following:
$ xcode-select --install
xcode-select: error: command line tools are already installed,
use "Software Update" to install updates
Fixed it by doing the following:
$ [sudo] xcode-select --reset
Hope this helps someone in the future.
EDIT
If someone is still running into issues, there's a thread on GitHub that has other solutions worth trying:
github.com/schnerd/d3-scale-cluster/issues

I had a simliar problem. Solving it was simple in the end.
Just had to run
xcode-select --install
to install the newest tools and then
sudo xcodebuild -license
to agree to the new License terms. Afterwards bcrypt got installed without any problems.

If sudo xcode-select --switch $(xcode-select -print-path) does not work for you, try re-install xcode:
$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install
See more: https://github.com/nodejs/node-gyp/issues/569

I managed to solve this by just opening Xcode, going to Preferences -> Locations -> Command Line Tools, and choosing it from the drop-down (it was empty before).

Following these steps helped me to resolve this issue on MacOS
sudo rm -rf $(xcode-select -print-path)
xcode-select --install
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp

Install xcode from(I prefer) https://developer.apple.com/download/more/ or xcode-select --install on terminal.
Then follow in order.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp

Related

node-gyp rebuild fails on Mac OS High Sierra while npm install

I am getting following error in the terminal, while it tries to install one of package "node-expat". I have tried switching to different node version using nvm but still it is failing with same error.
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/node-expat
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! node-expat#2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.0.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 node-expat 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 node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\<redacted>\npm-debug.log
I went ahead installing x-code as suggested on git hub page, on my machine and then it is giving following error,. Not sure how to debug further.
xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
I just got it fixed on my machine and my fellow colleagues machine.
Followed the following steps to fix it on MacOS highSierra 10.13:
Downloaded command line tools (MacOS 10.13) for xcode and installed it.
Download it from "https://developer.apple.com/download/more/"
Installed xcode 10.0 from the app store. Opened xcode and went through the regular configuration xcode does in the initial start up.
After this it started giving "xcode-select" path issue as stated in the description above. On running command "xcode-select --print-path" it was showing path as '/ Library/Developer/CommandLineTools', so i went ahead and tried "xcode-select --reset" after which the path changed to "/Applications/Xcode.app/Contents/Developer".
Immediately after it the build started working without any issues.
Solution above mentioned by Luke worked partially for me (MacOS) but created another issue :
gyp ERR! stack Error:makefailed with exit code: 2 which was solved by removing locked json file. Issue was created due to permission in MAC OS. So if you have xcode re-installed already, open terminal (command line) and type:
xcode-select --reset
then go to your project folder and remove:
package-lock.json
Now in terminal reinstall project :
npm install
I hope this helps someone!

Error while installing nodeshark

Hello I am install nodeshark from npmjs, but I have and error:
ubuntu#ubuntu:~/Documents$ sudo npm install nodeshark -g
(node:8720) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
> nodeshark#0.0.5 install /usr/local/lib/node_modules/nodeshark
> node mnm.js build
ERROR: Could not find "/usr/lib/i386-linux-gnu/glib-2.0/include" check GLIB_CONFIG_INCLUDE_DIR environment variable.
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "nodeshark" "-g"
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! nodeshark#0.0.5 install: `node mnm.js build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodeshark#0.0.5 install script 'node mnm.js 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 nodeshark package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node mnm.js build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodeshark
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodeshark
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! ubuntu#ubuntu:~/Documents/npm-debug.log
I have tried to install build-deb wireshark, but still don't work.
It seems that I need i386 for it to work, but I have this :
Linux ubuntu 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Can someone explain how I can solve this ?
It looks like it cant locate or dosent have the glib on line
ERROR: Could not find "/usr/lib/i386- linux-gnu/glib-2.0/include
You should make sure that file is available at the path specified or add the path to this file in the environment variables
if you haven't installed it previously
sudo apt-get install libperl-dev
sudo apt-get install libgtk2.0-dev
Another possibility is that it is incompatible with 64 bit systems, If this is true and also possible you can run it in a 32 bit vm (probably the best solution if you don't intend to reinstall a 32 bit distribution)
It is looking for a 32 bit library but you are running a 64 bit version of linux
you could try changing the library path to your version of this library
It appears that mnm is required to run this software if you haven't already installed it run
npm install mnm

Error when installing log.io using npm

I am trying to install log.io following the instruction from https://github.com/NarrativeScience/Log.io. It suggests using npm install command.
npm install -g log.io
The error I am getting is like below. And I tried on both Mac OS and Ubuntu, both no luck. Can anyone help me?
> contextify#0.1.13 install /usr/local/lib/node_modules/log.io/node_modules/jquery/node_modules/contextify
> node-gyp rebuild
npm http GET https://registry.npmjs.org/cssstyle
npm http GET https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/cssstyle
gyp: Call to 'node -e "require('nan')"' returned exit status 1. 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:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/log.io/node_modules/jquery/node_modules/contextify
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
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! Error: ENOENT, chown '/usr/local/lib/node_modules/log.io/node_modules/jquery/node_modules/jsdom/node_modules/request/README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
...
Finally I found the problems.
Ubuntu
On Ubuntu 14.04, the default repository of apt-get for node is not nodejs itself, but ax25-node. This will generate a default command node in /usr/sbin/ and does nothing if you call node (which is called by npm during the installation). I removed this package and created a symlink between node and nodejs, finally solved the problem.
sudo apt-get autoremove node
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g log.io
Mac OS
The error log is quite different from what I got from Ubuntu. After some googling about node-gyp installation failure, I found this issue, which led me to install the Xcode dev tools. Not sure why this happens but it seems there are some conflicts between homebrew and Xcode. Anyway, it finally works :-)
This looks like a race condition in an older version of npm. There have been a lot of improvements to npm -- especially around conflicts and race conditions during install -- since 1.4. Can you try updating your npm installation?
To update npm on Windows, follow the instructions here: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
If you still see the problem after updating npm, could you please upload your npm-debug.log as a gist http://gist.github.com? If possible, run npm with at least one -d flag to increase the logging level.
Thanks!
i create this install package...
http://tinyurl.com/kfnfng6
1 - download it
2 - untar it (tar -xvf install_log.io.tar)
3 - cd install_log.io
4 - sh install.sh
5 - enjoy!
This form is simple and quiet.. i hope help other users... What i do? simple.. download packages and dependencies , and put all in one package and create a script...
;)

NPM won't install any package on Mac. New, clean build. `EACCES` & other errors

I've just rebuild my Mavericks (Mac OS X Version 9.4) machine from scratch. I am the administrator and only user of this machine.
I installed Git via their git-2.0.1-intel-universal-snow-leopard.pkg (http://git-scm.com/downloads) in their default /usr/local/git/bin/git location.
I installed Node via their node-v0.10.30.pkg (http://nodejs.org/download/) in their default /usr/local/bin/node location.
The final step of Node's installer package included a note that they also installed NPM in their default /usr/local/bin/npm location.
My $PATH echoes /usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin (it contains /usr/local/bin).
Running npm install -g bower results in:
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/bower']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/bower',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/bower',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "bower"
npm ERR! cwd /Users/Home
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/bower
npm ERR! fstream_path /usr/local/lib/node_modules/bower
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/bower'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Home/npm-debug.log
npm ERR! not ok code 0
Running similar installations (npm install -g yo, npm install -g grunt, npm install -g nvm, npm install -g npm) results in what appears to be the same list of errors.
Several people online suggest forcing the installation via sudo, but several others warn this could cause later issues. The manuals for these packages seem not to mention requirement of sudo, and in some cases, they have advised contacting NPM when this issue arises.
Running npm cache clear does not correct the issue.
Running ls -la in the home (~) directory shows my Mac OS X username as the owner of my .npm directory: drwxr-xr-x 15 admin staff 510 Aug 11 23:53 .npm
Does anyone know what has gone wrong and how to correct this? Thank you.
By the way, I solved this issue by changing the owner of /usr/local to be myself, in order to allow NPM to modules in its default location without further requiring sudo for each package's installation.
sudo chown -R `whoami` /usr/local
EACCES is an error of not having access on doing an operation.
Taken the line: npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower' we can see that npm was unable to create a directory in the given location.
The reason is very likely that you are not running the command as super user. In fact, the error log is even suggesting that:
npm ERR! Please try running this command again as root/Administrator.
To run as administrator, you have to prefix those commands with sudo. That is:
sudo npm install -g bower. You will be required to type in a password for security reasons.
to start fresh remove prior node.js and npm installs as well as these :
~/.npmrc
~/.npm
~/tmp
~/.npm-init.js
to install nodejs and npm as yourself NOT root do these commands (linux) :
mkdir ${HOME}/bin
download source from : http://nodejs.org/download/
cd v0.10.30/
./configure --prefix=${HOME}/bin/nodejs
make -j8
make install
which puts it into dir defined by above --prefix
export PATH=${HOME}/bin/nodejs/bin:$PATH
NODE_PATH so node can find dir for modules otherwise
npm install xxx will put newly installed module into dir in curr dir :
export NODE_PATH=${HOME}/bin/nodejs/lib/node_modules
do above AND use syntax : npm install xxxxx -g
always use the -g for global
nodejs install gives you npm as well :
ls -la ${HOME}/bin/nodejs/bin
I'd recommend that you install Node.js using a version manager such as nvm. This way, you kill two birds with one stone:
First, you can manage multiple versions of Node.js on the same machine (which you will want to do sooner or later).
Second, you get around all the access problems you experience when installing Node.js without it. At least that's my experience.
Basically it's as easy as running
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | bash
from the command line.
(SOLUTION ANSWER)
Hi Guys,
I had the same problem on my MacBook Pro 2018. After trie installing any dependency globally (with "-g" or "--global") I did receive an issue "EACCES" error (it's about permissions)
You could simply add "sudo" before your commands what will force it.
For example:
sudo npm install gulp -g
or
sudo npm install browser-sync -g
Enjoy!
It's generally not advised to run sudo unless absolutely necessary.
For issues like this, NPM can solve many issues, and allow multiple node versions to be used, and selected depending upon your use case.
I had a similar issue setting up a new machine, and installing NPM took care of the issue.

NodeJS - Error installing with NPM

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Windows\system32>npm install caress-server
npm http GET https://registry.npmjs.org/caress-server
npm http 304 https://registry.npmjs.org/caress-server
npm http GET https://registry.npmjs.org/jspack/0.0.1
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/jspack/0.0.1
npm http 304 https://registry.npmjs.org/buffertools
> buffertools#2.0.1 install C:\Windows\system32\node_modules\caress-server\node_
modules\buffertools
> node-gyp rebuild
C:\Windows\system32\node_modules\caress-server\node_modules\buffertools>node "G:
\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\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 PYT
HON env variable.
gyp ERR! stack at failNoPython (G:\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:101:14)
gyp ERR! stack at G:\nodejs\node_modules\npm\node_modules\node-gyp\lib\confi
gure.js:64:11
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "G:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\caress-server\node_modules\buffert
ools
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! buffertools#2.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the buffertools#2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools 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 buffertools
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\\nodejs\\\\node.exe" "G:\\nodejs\\node_modules\\npm\\bin\\n
pm-cli.js" "install" "caress-server"
npm ERR! cwd C:\Windows\system32
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Windows\system32\npm-debug.log
npm ERR! not ok code 0
C:\Windows\system32>
I am installing a certain NodeJS script - Caress. But i am not unable to. I am using Windows 8.1, can anyone tell me what is the problem i am facing, and why is this installation not working. There seems to be a problem with the buffertools dependency, thats far as i can think. Dont know how maybe fix this?
If i download the build from github and place it in node-modules, nothing seems to work. when i try to start, using npm start, or during implementation either.
G:\nodejs\node_modules\caress-server>npm install
G:\nodejs\node_modules\caress-server>npm start
> caress-server#0.1.1 start G:\nodejs\node_modules\caress-server
> node examples/server.js
info - socket.io started
module.js:340
throw err;
^
Error: Cannot find module './build/Release/buffertools.node'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (G:\nodejs\node_modules\caress-server\node_modules\buf
fertools\buffertools.js:16:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
npm ERR! caress-server#0.1.1 start: `node examples/server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the caress-server#0.1.1 start script.
npm ERR! This is most likely a problem with the caress-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node examples/server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls caress-server
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\\nodejs\\\\node.exe" "G:\\nodejs\\node_modules\\npm\\bin\\n
pm-cli.js" "start"
npm ERR! cwd G:\nodejs\node_modules\caress-server
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! G:\nodejs\node_modules\caress-server\npm-debug.log
npm ERR! not ok code 0
G:\nodejs\node_modules\caress-server>
As commented below you may not need to install VS on windows, check this out
https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
UPDATED 02/2016
Some npm plugins need node-gyp to be installed.
However, node-gyp has its own dependencies (from the github page):
UPDATED 09/2016
If you're using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):
$ npm install --global --production windows-build-tools
and then install the package
$ npm install --global node-gyp
UPDATED 06/2018
https://github.com/nodejs/node-gyp/issues/809#issuecomment-155019383
Delete your $HOME/.node-gyp directory and try again.
See full documentation here: node-gyp
NOTE: This is an old answer that applied to earlier versions of NodeJS. My sincere gratitude to these open source projects that responded to this issue and resolved this former pain.
Make sure you have all the required software to run node-gyp:
https://github.com/TooTallNate/node-gyp
You can configure version of Visual Studio used by node-gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property every time you do an npm install.
Examples:
set GYP_MSVS_VERSION=2012 for Visual Studio 2012
set GYP_MSVS_VERSION=2013e (the 'e' stands for FREE 'express edition')
For the full list see
https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.
Feel free to add your vote at:
https://github.com/joyent/node/issues/8005#issuecomment-50545326
I encountered the issue with the error:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Here is what I was doing and what finally worked.
Disclaimer: I am just getting my hands into Node, Angular after many years in the Java, Linux world among others...
Environment Description: Windows 8.1 64-bit; Cygwin; cygwin bash shell
Command used that led to error: npm install -g karma
Error:
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
Discovery: 'which python' on bash shell clearly shows '/usr/bin/python'. Now that is annoying!
Solution: This is only applicable to those using the environment similar to what I have, i.e. using cygwin and bash shell. Hope it helps in other environments as well but keep in mind that your kettle of tea may look a little different than mine.
Firstly, need to set the $PYTHON shell env variable in .bashrc using the explicit windows path to the python executable and not the unix like root path (/usr/bin) used by cygwin.
Secondly, and this one took a lot of trial/error and here's the gotcha! Cygwin installs python under /usr/bin (which is really a mirror of /bin on windows) with the version, i.e. (in my system) /usr/bin/python2.7.exe and then adds a link /usr/bin/python --> python2.7.exe. The problem is that gyp cannot follow this link and keeps giving the annoying error that it cannot find python even though you can find it just fine from the shell command line.
With the above background now add the following line to your .bashrc
export PYTHON="C:/cygwin64/bin/python2.7.exe (or whatever is the version on your system)"
Now source your .bashrc from your home directory (on cygwin)--> 'source .bashrc'
You should be fine now and gyp will find the python executable.
I hope this helps someone stumbling on the same or similar issue.
should be able get all node-gyp dependencies with chocolatey for Windows
choco install python2
choco install visualstudioexpress2013windowsdesktop
Setup JavaScript Environment
1. Install Node.js
Download installer at NodeJs website. You can download the latest V6
2. Update Npm
Npm is installed together with Node.js. So don't worry.
3. Install Anaconda
Anaconda is the leading open data science platform powered by Python. The open source version of Anaconda is a high performance distribution of Python. It can help you to manage your python dependency. You can use it to create different python environment in the futher if you want to touch with it.
Node-gyp only support >= Python 2.7 and < Python 3.0
So just install the 2.7 version
4. Install Node-gyp
You can install with npm:
$ npm install -g node-gyp
You will also need to install:
On Windows:
Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2: Install tools and configuration manually:
Visual C++ Build Environment:
Option 1: Install Visual C++ Build Tools using the Default Install option.
Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.
💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1
Launch cmd, npm config set msvs_version 2015
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable:
$ node-gyp --python C:/Anaconda2/python.exe
If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm's 'python' config key to the appropriate value:
$ npm config set python C:/Anaconda2/python.exe
Future update for Node.js and npm
Download installer from their official website and direct install it. The installer will automatic help you to remove old files.
npm update npm
Future update for Python
conda update --all
Fixed with downgrading Node from v12.8.1 to v11.15.0 and everything installed successfully
gyp ERR! configure error gyp ERR! stack Error: Can't find Python
executable "python", you can set the PYT HON env variable.
This means the Python env. variable should point to the executable python file, in my case:
SET PYTHON=C:\work\_env\Python27\python.exe
For Cygwin users:
The python issue with using npm on an out-of-the-box Cygwin installation, is that node-gyp is giving a misleading error due to incomplete checking in the ../npm/node_modules/node-gyp/lib/configure.js code.
It's due to how Cygwin treats symbolic links. It doesn't do that properly in an out-of-the box installation. So the error messages from the above code become misleading, as it complains about the PYTHON path and not the existence of python.exe (or link of) file itself.
There are (at least) 2 ways to resolve this.
Installing the Cygwin package cygutils-extra and use winln.
Use native Windows CMD in Admin mode.
For (1) you can create a proper symlink from within Cygwin shell by doing these steps:
# To make the Cygwin environment treat Windows links properly:
# Alternatively add this to your `.bashrc` for permanent use.
export CYGWIN=winsymlinks:nativestrict
# Install Cygwin package containing "winln"
apt-cyg install cygutils-extra
# Make a proper Windows sym-link:
cd /cygdrive/c/cygwin64/bin/
winln.exe -s python2.7.exe python.exe
# Add PYTHON as a native Windows system wide variable (HKLM)
setx /M PYTHON "C:\cygwin64\bin\python"
(Also assuming you are running the Cygwin shell as Admin.)
Using apt-cyg is recommended and can be found in various forms on github.
For (2) the resolution for out-of-the-box Cygwin users is this:
# Open a native Windows CMD in Administrator mode and:
cd C:\cygwin64\bin\
mklink python.exe python2.7.exe
The result should look like this:
C:\cygwin64\bin>ls -al python*
lrwxrwxrwx 1 xxx xxx 13 Jun 2 2015 python -> python2.7.exe
lrwxrwxrwx 1 Administrators xxx 13 Aug 24 17:28 python.exe -> python2.7.exe
lrwxrwxrwx 1 xxx xxx 13 Jun 2 2015 python2 -> python2.7.exe
-rwxr-xr-x 1 xxx xxx 9235 Jun 2 2015 python2.7.exe
For windows
Check python path in system variable.
npm plugins need node-gyp to be installed.
open command prompt with admin rights, and run following command.
npm install --global --production windows-build-tools
npm install --global node-gyp
I was working on an old Vue 2.x project, at least 2 years old and deps were never updated. Reverting to Node v10.16.3 worked for me. Versions 14 and 12 did not work.
for me the solution was:
rm -rf ~/.node_gyp and
sudo npm install -g node-gyp#3.4.0
cd /usr/local/lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
brew install gcc
npm install
I was installing appium by npm install -g appium and getting the same error on Windows 10.
Below command worked for me:
npm --add-python-to-path='true' --debug install --global windows-build-tools
https://github.com/felixrieseberg/windows-build-tools/issues/33
The question is already answered but these were not working in my case which is alpine Linux based OS so maybe this helps someone else.
I was also getting same error
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
So fix by single line just add this if you are working in Dockerfile or install it in OS
apk add --no-cache python nodejs
in ubuntu
sudo apt-get install python3.6
Note: Node version:8
install node-gyp and c++ compiler (gcc-c++).
npm install --global --production windows-build-tools

Resources