serverless-puresec-cli
serverless-puresec-cli copied to clipboard
Cannot npm install
Environment:
- NPM: 3.10.10
- Win 10
- Python 3.6.5
- Node: 6.10.2
- Serverless: 1.27.2
Steps to reproduce:
- run npm command
npm install --save-dev serverless-puresec-cli
Output:
$ npm install --save-dev serverless-puresec-cli
[email protected] install C:\Users*\Documents*****\node_modules\serverless-puresec-cli npip install
No python_modules directory; installing pip locally if needed. Error: spawn python3 ENOENT at exports._errnoException (util.js:1018:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! Windows_NT 10.0.17134 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i" "--save-dev" "serverless-puresec-cli" npm ERR! node v6.10.2 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: npip install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'npip install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the serverless-puresec-cli package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npip install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs serverless-puresec-cli
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls serverless-puresec-cli
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! C:\Users*\Documents*****\npm-debug.log
Might be npip install
command?
Hi @frankTurtle, Thank you for opening the issue and letting us know.
During the plugin download, we install our core PureSec CLI which is written in python.
To support environments with both python 3 and python 2 we execute python3
command. It seems that either python 3 binary is called python.exe
or you need to add your python directory path to the PATH
environment variable.
This thread should be helpul in solving this issue: how-to-switch-between-python-2-7-to-python-3-from-command-line
Please let me know if it helped.
Hey @avish9
Thanks for the quick reply!
The python directory is in the PATH env already, unfortunately. I've never had python 2.x installed either, so there would be no issues with switching between the two.
Thanks!
Hi @frankTurtle ,
Did you manage to get it working?
I ran into the same issue when attempting an install on Mac OS 10.13.5.
which python
returned /usr/bin/python
, and which python3
returned nothing.
I downloaded and installed python 3 from https://www.python.org/downloads/mac-osx/, and now which python3
returns /usr/local/bin/python3
, and npm install --save-dev serverless-puresec-cli
completes successfully.
@mrweir - thanks for the input!
@avish9 shouldn't this be included in the documentation?
I had to copy/rename python.exe to python3.exe but now I'm getting:
ERROR: Could not install packages due to an EnvironmentError: [WinError 206] The filename or extension is too long: '<redacted>\\node_modules\\serverless-puresec-cli\\python_modules\\Python38\\site-packages\\puresec_cli\\resources\\node_modules\\app-module-path\\test\\node_modules\\installed-module-allowed-explicit\\installed-module-allowed-explicit-foo'
and install fails.
Edit: this was resolved by enabling 'long paths' in win registry: https://stackoverflow.com/a/46489473 Edit 2: long paths setting seems to mess up my nginx install... (side note...) But now I'm stuck on #17