Closed kasrasadeghi closed 6 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
This is the log file. npm-debug.log
Reproduced with a similar error using a fresh Ubuntu 16.04 (after installing nodejs
and npm
):
root@test:~# npm install -g elm
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
/usr/local/bin/elm -> /usr/local/lib/node_modules/elm/binwrappers/elm
/usr/local/bin/elm-make -> /usr/local/lib/node_modules/elm/binwrappers/elm-make
/usr/local/bin/elm-package -> /usr/local/lib/node_modules/elm/binwrappers/elm-package
/usr/local/bin/elm-reactor -> /usr/local/lib/node_modules/elm/binwrappers/elm-reactor
/usr/local/bin/elm-repl -> /usr/local/lib/node_modules/elm/binwrappers/elm-repl
> elm@0.18.0 install /usr/local/lib/node_modules/elm
> node install.js
sh: 1: node: not found
npm ERR! Linux 4.4.0-57-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "elm"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! elm@0.18.0 install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the elm@0.18.0 install script 'node install.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 elm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs elm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls elm
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
It was fixed for me after running apt-get install nodejs-legacy
, which installs a symlink (/usr/bin/node -> nodejs). Does it work for you?
The error probably comes from this line:
"install": "node install.js"
Can it be fixed so it works for Ubuntu users who didn't install nodejs-legacy
?
Or should the documentation for the NPM package be updated to say Ubuntu users must install nodejs-legacy
?
Installing nodejs-legacy didn't work. I also tried just installing nodejs. As I'm using NVM, the executable for node.js is "node" and while your line says sh: 1: node: not found
mine says sh: 1: node: Permission denied
, even as root.
I think I may need to find the node executable and then chown
something.
EDIT: nope, that doesn't seem to have worked.
I resolved it by following this thanks to @eeue56.
Stumbled upon the same issue on an Ubuntu 16.10 machine, installing nodejs-legacy
did the trick.
@kasrasadeghi As a general rule/warning to everyone: NEVER CHOWN ANYTHING IN YOUR /usr
or any default root directory. It can seriously ruin your OS.
@kasrasadeghi you can fix it by:
$ sudo chown -R $(whoami) ~/.npm
$ sudo chown -R $(whoami) /usr/local/lib/node_modules
then reinstall elm by:
$ npm install -g elm ## NO SUDO! NO ROOT!
Never ever sudo chown anything like this. It can break your OS. Node is shit, stop using it. Try yarn instead.
On Tue, 08 Aug 2017 at 2:19 PM minhchuduc
< mailto:minhchuduc notifications@github.com
wrote:
a, pre, code, a:link, body { word-wrap: break-word !important; }
https://github.com/kasrasadeghi you can fix it by:
sudo chown -R $(whoami) ~/.npm sudo chown -R $(whoami) /usr/local/lib/node_modules
then reinstall elm by:
$ npm install -g elm ## NO SUDO! NO ROOT!
—
You are receiving this because you commented.
Reply to this email directly, https://github.com/elm-lang/elm-platform/issues/195#issuecomment-320831328 , or https://github.com/notifications/unsubscribe-auth/AJoldKg15a1bHavPBneAbyKW2DYDSng_ks5sV8W9gaJpZM4LehWk .
OP's issue was resolved.
I'm using nvm to install Node.js.
After doing so, when I try
npm install -g elm
it gives the following printout:
EDIT: This is on Ubuntu 16.10