0

I am installing bcrypt for my project to use salting in hash function using the command - npm i bcrypt@3.0.2

My current node version is 10.16.0 I have installed nvm to update my previous node version from 10.15.3

but while installing I am getting these errors-

"node" is not recognized as an internal or external command,
operable program or batch file.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.2 install: "node-pre-gyp install --fallback-to-build"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.0.2 install script
npm ERR! This is probably not a problem with npm, There is likely additional logging output above.

npm ERR! A complete log og this run can be found in:
npm ERR! C:Users\Ansh\AppData\Roaming\npm-cache\_logs\2019-06-17T06_05_15-252Z-debug.log

Update I have managed to install the bcrypt package but the issue mentioned is still present. Actually, I am using windows OS and for running these commands I was using Hyper as terminal, which is creating these errors. I tried to run the bcrypt install command using Administrative privileges through PowerShell and it was successful, without any errors.

I tried to install a few more packages(like passport, express-session, etc) through Hyper and I am facing somewhat similar errors, but when I run those in PowerShell, it works just fine.

I have managed to make things work for me, but I still don't understand the logic behind this. If anyone has any idea about it, please share and then I can close this.

2 Answers2

0

There are a lot of bug reports at the official repository about this - have you made sure that you've read the full installation instructions for this library, including the installation of some build tools? Maybe running the following line in a command line with admin privileges already helps?

npm install --global --production windows-build-tools
Nico Haase
  • 11,420
  • 35
  • 43
  • 69
  • Yes I have gone through all of them and even tried your mentioned command but it also shows a similar error, I think the main error is this - `npm ERR! This is probably not a problem with npm, There is likely additional logging output above` – Ansh Agrawal Jun 17 '19 at 07:59
  • And what about inspecting the complete log file for this? Maybe it lists more information – Nico Haase Jun 17 '19 at 08:00
  • I checked that too, I couldn't make much out of it, ``` 1222 verbose stack at EventEmitter. 1222 verbose stack at EventEmitter.emit (events.js:189:13) 1222 verbose stack at ChildProcess. (C:\Users\Ansh\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 1222 verbose stack at ChildProcess.emit (events.js:189:13) 1222 verbose stack at maybeClose (internal/child_process.js:970:16) 1222 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)``` – Ansh Agrawal Jun 17 '19 at 08:14
0

hi try this command line maybe its will help you

npm install bcrypt@3 --save

Vimal
  • 1
  • 2