Serverless fails to install on Ubuntu 17.04
See original GitHub issueHi,
I’ve tried to install Serverless framework on “new, fresh” installment of Ubuntu 17.04.
I’ve installed NodeJS using Ubuntu official repository. Version that I was offered is NodeJS v4.7.2. After that following instructions, I’ve installed npm, again same from official Ubuntu official repository. Version installed v3.5.2.
Finally, when I started to install Serverless
Framework, I’ve got the following error:
astoisavljevic@aleksandar-virtualbox:~$ sudo npm install -g serverless /usr/local/bin/serverless -> /usr/local/lib/node_modules/serverless/bin/serverless /usr/local/bin/slss -> /usr/local/lib/node_modules/serverless/bin/serverless /usr/local/bin/sls -> /usr/local/lib/node_modules/serverless/bin/serverless
serverless@1.11.0 postinstall /usr/local/lib/node_modules/serverless node ./scripts/postinstall.js
sh: 1: node: not found npm ERR! Linux 4.10.0-19-generic npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “install” “-g” “serverless” npm ERR! node v4.7.2 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn
npm ERR! serverless@1.11.0 postinstall: node ./scripts/postinstall.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the serverless@1.11.0 postinstall script ‘node ./scripts/postinstall.js’.
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 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./scripts/postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs serverless
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls serverless
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/astoisavljevic/npm-debug.log
As requested, I’m attaching npm-debug.log file to this ticket.
Thank You
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Is there any reason why you need to execute node in a root context via sudo? Is the node executable accessible in your user context too? Just try
which nodejs
. Additionally the executable should at least be available under the name “node” and not only “nodejs”.Having a similar issue with $ node --version v6.12.3
I’m gonna try installing nvm and switching node version