Reputation: 1
I am using node.js on LINUX plcnext plc but I have installed another PYTHON version. I made sure that it is stated in my PATH and PYTHON variables and I also set it in npm using npm config set python
. Yet I receive the same error Error: Can't find Python executable. Check all code below
When I type which python
I get correct path:
/home/root/.guix-profile/bin/python
Result for echo $PYTHON
:
/home/root/.guix-profile/bin
Result for echo $PATH
:
/home/root/.guix-profile/bin:/home/root/.guix-profile/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/plcnext/apps/60002172000051/opt/node-v10.15.3-linux-armv7l/bin:/opt/plcnext/appshome/data/60002172000051/bin:/opt/bin:/opt/sbin:/opt/plcnext/apps/60002172000051/opt/node-v10.15.3-linux-armv7l/bin:/opt/plcnext/appshome/data/60002172000051/bin
Command I used to set python in npm:
npm config set python /home/root/.guix-profile/bin
When I try command "npm install -g bcrypt" I receive error:
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "/home/root/.guix-profile/bin", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/opt/plcnext/apps/60002172000051/opt/node-v10.15.3-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/opt/plcnext/apps/60002172000051/opt/node-v10.15.3-linux-armv7l/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
Upvotes: 0
Views: 338
Reputation: 111
The $PYTHON variable needs to be the executeable or a link to the executeable and not the lookup directory
PYTHON=/home/root/.guix-profile/bin/python
Upvotes: 4