Closed songproducer closed 6 years ago
Hey thanks for reporting! I'm wondering how we can get this to work on both systems with /usr/bin/python
and /usr/local/bin/python
though, I'm thinking something like
npm config set python $(which python)
but I wonder why that would be necessary, you'd think that node-webcrypto-ossl could use whichever system python is available. But thanks for the report I'll try and investigate this further
@roo2 checking also, is this still an outstanding issue?
Yea still outstanding, I haven't tested this one with OSX yet either
It also seems that Python >2.5 and <3 must be used for compiling node-webcrypto-ossl
Python 3.6
npm config set python /path/to/python36/python
npm install
gives
> node-webcrypto-ossl@1.0.31 install
/aletheia-app/node_modules/node-webcrypto-ossl
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/path/to/python36/python" is v3.6.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack at emitOne (events.js:96:13)
gyp ERR! stack at Socket.emit (events.js:188:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:498:12)
gyp ERR! System Darwin 17.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd aletheia-app/node_modules/node-webcrypto-ossl
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Python 2.7
npm config set python /path/to/python27/python
npm install
works fine. (tested with Anaconda distribution)
@Yannael you legend!
How do you set python2.7 as the global npm default?
Hi @DarinDev1000 Unfortunately we don't have any developers working on the project at the moment, so I'm not able to answer your query. I am hoping to have some people working on this project in the new year though, so hopefully down the track we will get this sorted for you.
No problem. I got it figured out.
@DarinDev1000 can u share the solution?
@DarinDev1000 can u share the solution?
@latishk Here is how to change npm/node defaults. (FYI: After this, python3 is still my bash default. I did not change my PATH) (These instructions were created for a MAC)
This list all npm configurations currently set.
npm config list
You may see a userconfig file:
/Users/<userName>/.npmrc
and a globalconfig file:
/Users/<userName>/.nvm/versions/node/v8.9.1/etc/npmrc
This list all configs including defaults:
npm config ls -l
To set a global config, run:
npm config set init-author-name "<Name>" -g
This auto sets the npm author name every time you run "npm init".
The "-g" tag sets a global config. Otherwise it is a user config.
Another way to change this is to add init-author-name = "<Name>"
To set the python path, run:
npm config set python </path/to/python2> -g
For me, this was:
npm config set python "/usr/bin/python2.7" -g
or, edit the "globalconfig" file and add:
python = "/usr/bin/python2.7"
After changing my npm python path, npm install
ran correctly!
External reference: global npm setting defaults
I hope this helps. Let me know if you have questions.
When running:
npm install
This was the error:
Solution is to set the correct python path for npm like this:
npm config set python /usr/bin/python