[Solved] Can't install bcrypt

[Solved] Can't install bcrypt
0

#1

when i am trying to install bcrypt package I got some error .
I am using windows 7 x64, node v 6.9.4, npm 3.10.10

D:\git\fcc\login>npm install bcrypt --save

> [email protected] install D:\git\fcc\login\node_modules\bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-n
ode-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile wit
h node-gyp)

D:\git\fcc\login\node_modules\bcrypt>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" clean )  else (node "" clean )

D:\git\fcc\login\node_modules\bcrypt>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" configure --fallback-to-build --module=D:\git\fcc\login\node_modules\bcrypt
\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\git\fcc\login\node_modules\bcrypt\lib\binding --python=C:\
Users\moens\.windows-build-tools\python27\python.exe --msvs_version=2015 )  else (node "" configure --fallback-to-build --module=
D:\git\fcc\login\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\git\fcc\login\node_mod
ules\bcrypt\lib\binding --python=C:\Users\moens\.windows-build-tools\python27\python.exe --msvs_version=2015 )

D:\git\fcc\login\node_modules\bcrypt>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" build --fallback-to-build --module=D:\git\fcc\login\node_modules\bcrypt\lib
\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\git\fcc\login\node_modules\bcrypt\lib\binding )  else (node ""
build --fallback-to-build --module=D:\git\fcc\login\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --m
odule_path=D:\git\fcc\login\node_modules\bcrypt\lib\binding )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
D:\git\fcc\login\node_modules\bcrypt\build\bcrypt_lib.vcxproj(20,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Defau
lt.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215: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" "build" "--fallback-to-build" "--module=D:\\git\\fcc\\login\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node"
"--module_name=bcrypt_lib" "--module_path=D:\\git\\fcc\\login\\node_modules\\bcrypt\\lib\\binding"
gyp ERR! cwd D:\git\fcc\login\node_modules\bcrypt
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\git\fcc\login\node_modules\bcrypt\lib\binding\bcrypt_lib.no
de --module_name=bcrypt_lib --module_path=D:\git\fcc\login\node_modules\bcrypt\lib\binding' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
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" "bc
rypt" "--save"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-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 bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\git\fcc\login\npm-debug.log

#2

don’t what exactly make this problem go away

but I check issue page and there some suggest

npm install --global --production windows-build-tools

after about 40 min of installation, python installed and Visual C++ Build Environment installed but installation process still continued. At some point, I got confused so I quite the process. but after that when I install bcrypt it gives 2 npm err but all functionalities working just fine.

Maybe Python or Visual C++ build environment did the magic


#3

it doesn’t work. ERR persists


#4

How about using bcrypt-nodejs? They say it’s not as painful to install as bcrypt on Windows.