Hello Guys, How are you all? Hope You all Are Fine. Today I Just want to use bcrypt in my nodejs project but as I added bcrypt to my package.json I am facing following error Error: Could not find any Python installation to use in NodeJS. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How this Error Occurs ?
I Just want to use bcrypt in my nodejs project but as I added bcrypt to my package.json I am facing following error.
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if “python” can be used
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use
How To Solve Error: Could not find any Python installation to use Error ?
- How To Solve Error: Could not find any Python installation to use Error ?
To Solve Error: Could not find any Python installation to use Error If You are using windows and You are facing this error then Just run this command administrator privileges in your cmd: npm install –global –production windows-build-tools Now, your error must be solved. Second solution is Just add this line in your docker file before Npm Install: RUN apk add –update python make g++\ && rm -rf /var/cache/apk/*
- Error: Could not find any Python installation to use
To Solve Error: Could not find any Python installation to use Error If You are using windows and You are facing this error then Just run this command administrator privileges in your cmd: npm install –global –production windows-build-tools Now, your error must be solved. Second solution is Just add this line in your docker file before Npm Install: RUN apk add –update python make g++\ && rm -rf /var/cache/apk/*
Solution 1: For Windows users
If You are using windows and You are facing this error then Just run this command administrator privileges in your cmd.
npm install --global --production windows-build-tools
Now, your error must be solved.
Solution 2: For docker
Just add this line in your docker file before Npm Install.
RUN apk add --update python make g++\
&& rm -rf /var/cache/apk/*
Solution 3: Use bcryptjs instead of bcrypt
Just Use bcryptjs instead of bcrypt.
With bcryptjs there are no errors. Neither with standard node docker images nor node alpine docker images. Now your error should be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read