0

i tried several solutions. like

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

and

  npm install node-gyp -g 

before trying to

  npm install bcrypt 

but still it's shows this error.

> bcrypt@4.0.1 install C:\Users\Ethel\AppData\Roaming\npm\node_modules                                                                                                  
\bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/                                                                                                  
node.bcrypt.js/releases/download/v4.0.1/bcrypt_lib-v4.0.1-napi-v3-win3                                                                                                  
2-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@4.0.1 and no                                                                                                  
de@12.15.0 (node-v72 ABI, unknown) (falling back to source compile wit                                                                                                  
h node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm config                                                                                                  
uration
gyp ERR! find Python Python is not set from environment variable PYTHO                                                                                                  
N
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find P                                                                                                  
ython 2
hel\AppData\Roaming\npm\node_modules\bc                                                                                                  
rypt\lib\binding\napi-v3 --napi_version=5 --node_abi_napi=napi --napi_                                                                                                  
build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@4.0.1 install: `node-pre-gyp install --fallback-to-bui                                                                                                  
ld`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@4.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely addi                                                                                                  
tional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ethel\AppData\Roaming\npm-cache\_logs\2020-03-09                                                                                                  
T01_40_45_056Z-debug.log

i just had to cut the error here but it's way too long to post here. anyone knows what should i do? thank you in advance

chrannbon
  • 51
  • 1
  • 8
  • Try to install python 2.7 and make sure PATH is set, if you are on Windows OS. – Zeeshan Hassan Memon Mar 08 '20 at 10:55
  • Some helpful links: https://superuser.com/questions/1421261/node-gyp-error-on-running-npm-install https://github.com/nodejs/node-gyp/issues/1977 https://stackoverflow.com/questions/21365714/nodejs-error-installing-with-npm – Zeeshan Hassan Memon Mar 08 '20 at 11:00

1 Answers1

0

The error mentions python is missing from your path. It seems the package requires python to build.

gyp ERR! find Python - "python" is not in PATH or produced an error

Type python in the command line and see if it starts up the python REPL. If it does not, install python, make sure it is in your path, then try to install the package again.

Chief Oye
  • 26
  • 4
  • how can o add this to path if the file location is inside my node_module folder. – chrannbon Mar 08 '20 at 10:40
  • Just install Python from the official website. If you are on Windows, click the add to path option when installing. Here is the link https://www.python.org/downloads/ – Chief Oye Mar 08 '20 at 14:20