Trouble with node bcrypt installation - node.js

I am learning sails.js. So I just want to encrypt password using node module bcrypt.
npm install bcrypt is the command what I use to install bcrypt modules, I came to know that it has many dependencies, I intalled node-gyp as well npm install -g node-gyp
Can anyone suggest how can I get it resolved?
Error :
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning
C4530: C++ exception handler used, but unwind semantics are not enabled. Specif
y /EHsc [c:\Users\Aditya Sethi\Documents\backup\My-Twitter\node_modules\bcrypt\
build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(38): fatal error C1083: Cannot open include file: 'openss
l/rand.h': No such file or directory [c:\Users\Aditya Sethi\Documents\backup\My
-Twitter\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\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: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 Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Aditya Sethi\Documents\backup\My-Twitter\node_modules\bcry
pt
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok
npm ERR! bcrypt#0.7.7 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.7.7 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 Windows_NT 6.1.7601
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! cwd c:\Users\Aditya Sethi\Documents\backup\My-Twitter
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\Users\Aditya Sethi\Documents\backup\My-Twitter\npm-debug.log
npm ERR! not ok code 0

I had pretty much the same problem on Ubuntu 13.10, the error log looked the same and the bcrypt installation stopped at node-gyp rebuild. After some searching and updating node and npm I still had the same issues.
I found a solution finally here: https://github.com/ncb000gt/node.bcrypt.js/issues/90 and the problem was the ~/.node-gyp directory which had unsufficient access rights and simply deleting it did the trick. This is where gyp stores headers and other build files during compilation and if it's gone, gyp will just recreate it.

Try to install global windows build tool if you are using windows,
follow this link bcrypt install instruction
npm install --global --production windows-build-tools

Related

npm install fails on Windows 10 (node-gyp rebuild)

I'm trying to do a npm install for a cloned project that uses nodejs and node-gyp. Experienced a lot of version mismatch issues (especially with Visual Studio) and got to a point where node-gyp rebuild fails on rebuild.
Installed Python 2.7, uninstalled VS2013 and installed VS2015 Community edition with Visual C++ 2015. Changed the environment variable GYP_MSVS_VERSION to 2015 using SET GYP_MSVS_VERSION=2015, did npm config set msvs_version 2015 --global, ran npm install -g --msvs_version=2015 and got the following errors. Nothing I did moved the process further at this point and have been trying for 5+ hours!
I'm using Cmder (running as administrator), npm v3.6.0, node v5.7.0 and node-gyp v3.3.1 (running node-gyp -v results in v3.3.1).
I'm on Windows 10 x64.
Anyone has any idea what's causing these errors?
..\src\WebWorkerThreads.cc(231): error C2660: 'v8::Isolate::New': function does not take 0 arguments [C:\Users \ramtin\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads\build\WebWorkerThr eads.vcxproj]
..\src\WebWorkerThreads.cc(540): warning C4996: 'node::FatalException': was declared deprecated [C:\Users\ramt in\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads\build\WebWorkerThreads. vcxproj]
C:\Users\ramtin\.node-gyp\5.7.0\include\node\node.h(282): note: see declaration of 'node::FatalException'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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:276:23)
gyp ERR! stack at emitTwo (events.js:100:13)
gyp ERR! stack at ChildProcess.emit (events.js:185:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
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\ramtin\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads
gyp ERR! node -v v5.7.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
C:\Users\ramtin\AppData\Roaming\npm
`-- (empty)
npm WARN optional Skipping failed optional dependency /troop-node-enforcer/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.8
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" "-g" "--msvs_version=2015"
npm ERR! node v5.7.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! webworker-threads#0.5.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webworker-threads#0.5.7 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 webworker-threads 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 webworker-threads
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls webworker-threads
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\ramtin\trooptraining\troop\troop-node-enforcer\npm-debug.log
npm ERR! code 1
The problem is that the version of troop-node-enforcer being installed is depending on an older version of the webworker-threads module which is outdated. The npm log shows it installing v0.5.7 whereas the newest version is v0.7.1 and has had many fixes since the older version.

npm install lead to gyp ERR! build error (node-java)

i have project with nodejs & java code , the project working fine on MAC but
when trying to install project on Windows7 64 bit i get the following error :
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\HDaghash\Documents\QosAdministration\node_modules\java
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
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\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! java#0.6.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java#0.6.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java 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 java
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\HDaghash\Documents\QosAdministration\npm-debug.log
i tried to install visual studio 2012 instead of 2013 as i read in some tickets on github but the same issue still exist.
any one can help with this issue ?
Thanks in advance .
It has a dependency on node-gyp node module and node-gyp does not install in windows.
Here is the solution ...
Java Setup
npm install -g node-gyp
Run
in administrator privileged command prompt window
npm install --global --production windows-build-tools
npm update
npm install java

Cant install asyncawait using npm

I have tried to run
npm install asyncawait --save
On my project , and it first failed and i needed to install python , now its outputting this errors:
D:\Projects\Lounge\Lounge>npm install asyncawait --save
> fibers#1.0.7 install D:\Projects\Lounge\Lounge\node_modules\fibers
> node build.js || nodejs build.js
D:\Projects\Lounge\Lounge\node_modules\fibers>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 --release ) else (node rebuild --release )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number.
[D:\Projects\Lounge\Lounge\node_modules\fibers\build\fibers.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [D:\Projects\Lounge\Lou
nge\node_modules\fibers\build\fibers.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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: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 10.0.10240
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" "--release"
gyp ERR! cwd D:\Projects\Lounge\Lounge\node_modules\fibers
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
'nodejs' is not recognized as an internal or external command,
operable program or batch file.
Lounge#0.0.0 D:\Projects\Lounge\Lounge
└── (empty)
npm WARN EPACKAGEJSON Lounge#0.0.0 No repository field.
npm WARN EPACKAGEJSON Lounge#0.0.0 No license field.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "asyncawait" "--save"
npm ERR! node v4.1.0
npm ERR! npm v3.3.4
npm ERR! code ELIFECYCLE
npm ERR! fibers#1.0.7 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.7 install script 'node build.js || nodejs build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js || nodejs build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Projects\Lounge\Lounge\npm-debug.log
npm ERR! code 1
Im using visual studios 2015 , have c++ compilers (2010-2015 both 64 and 32 bit)
node 4.1.0.
I am running nearly the same stack and when I got the errors to that point, updating NPM using npm-windows-upgrade got everything worked out (just to note, the author is a Microsoft employee).
Basic usage from a PowerShell prompt:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
then
npm install -g npm-windows-upgrade
npm-windows-upgrade
Turns out i needed to install some optional c++ stuff for vs 2015 , which were not included , and it all worked after it.

Unable to use npm install with zerorpc - error with the msgpack package

When I attempt to install the zerorpc library using npm as follows:
npm install zerorpc
I get the following error:
C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack>node "C:\Program Files (x86)\nodejs\node
_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
object.cpp
objectc.c
unpack.c
vrefbuffer.c
zone.c
version.c
libmsgpack.vcxproj -> C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack\build\Release\\
libmsgpack.lib
msgpack.cc
..\src\msgpack.cc(181): error C2466: cannot allocate an array of constant size 0 [C:\Users\Jeff\AppData\Roaming\npm
\node_modules\zerorpc\node_modules\msgpack\build\msgpackBinding.vcxproj]
..\src\msgpack.cc(181): error C2440: 'initializing' : cannot convert from 'int' to 'v8::Handle<v8::Value>' [C:\User
s\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack\build\msgpackBinding.vcxproj]
Constructor for class 'v8::Handle<v8::Value>' is declared 'explicit'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\
build.js:267:23)
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 Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.j
s" "rebuild"
gyp ERR! cwd C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
And at the end of the installation process, I get the following errors:
npm ERR! msgpack#0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the msgpack#0.1.8 install script.
npm ERR! This is most likely a problem with the msgpack 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 msgpack
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\
bin\\npm-cli.js" "install" "-g" "zerorpc"
npm ERR! cwd C:\node\pythontest
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\node\pythontest\npm-debug.log
npm ERR! not ok code 0
I'm running a clean install of Node.js on Windows 7 (x64).
Has anyone encountered this error before, and if so, how should I go about fixing it?
Thanks!
Edit:
When I install msgpack separately as follows:
npm install msgpack
It installs successfully:
C:\node\pythontest\node_modules\msgpack>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..
\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
gcc_atomic.cpp
object.cpp
objectc.c
unpack.c
vrefbuffer.c
zone.c
version.c
libmsgpack.vcxproj -> C:\node\pythontest\node_modules\msgpack\build\Release\\libmsgpack.lib
msgpack.cc
C:\Users\Jeff\.node-gyp\0.10.31\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Pe
rsistent<v8::Object> v8::Persistent<v8::Object>::New(v8::Handle<v8::Object>)' [C:\node\pythontest\node_modules\msgp
ack\build\msgpackBinding.vcxproj]
C:\Users\Jeff\.node-gyp\0.10.31\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Pe
rsistent<v8::FunctionTemplate> v8::Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' [C:\nod
e\pythontest\node_modules\msgpack\build\msgpackBinding.vcxproj]
Creating library C:\node\pythontest\node_modules\msgpack\build\Release\msgpackBinding.lib and object C:\node\p
ythontest\node_modules\msgpack\build\Release\msgpackBinding.exp
Generating code
c:\node\pythontest\node_modules\msgpack\src\msgpack.cc(360): warning C4715: 'unpack' : not all control paths return
a value [C:\node\pythontest\node_modules\msgpack\build\msgpackBinding.vcxproj]
Finished generating code
msgpackBinding.vcxproj -> C:\node\pythontest\node_modules\msgpack\build\Release\\msgpackBinding.node
msgpack#0.2.4 node_modules\msgpack
└── nan#1.0.0

npm install fails with gyp build error

I have been trying to get node and git working for a web project I am working on without any luck.
I have installed node from their website. When I try to do npm install on the git project I am working on it gives me the following error
C:\Users\Jibran\Desktop\ekhadim\ekhadimweb>npm install
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> bcrypt#0.7.8 install C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\b
crypt
> node-gyp rebuild
C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt>node "C:\Program
Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\
node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'bcrypt_lib.vcxproj' is
invalid. Platform='x64'. You may be seeing this message because you are tryin
g to build a project without a solution file, and have specified a non-default
Platform that doesn't exist for this project. [C:\Users\Jibran\Desktop\ekhadim\
ekhadimweb\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\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:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:807:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! bcrypt#0.7.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.7.8 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 Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\npm-debug.log
npm ERR! not ok code 0
I have installed python, VC++ 2008 and 2010 and OpenSSL but nothing has worked for me yet.
Any help will be appreciated.
Thanks
Jibran
Installing windows build tools worked for me:
npm install --global --production windows-build-tools
Follow : https://github.com/nodejs/node-gyp#installation
Installing windows-build-tools didn't work for me. What did the trick was directly downloading and installing Python.

Resources