workshopper / learnyounode

Learn You The Node.js For Much Win! An intro to Node.js via a set of self-guided workshops.
Other
7.24k stars 1.84k forks source link

Global install under linux failing due to "Unhandled Rejection Error" #621

Closed questionmarcus closed 6 years ago

questionmarcus commented 6 years ago

Full cmd output here:

sudo npm install -g learnyounode 
npm WARN deprecated boganipsum@0.1.0: no longer maintained
npm WARN deprecated colors-tmpl@1.0.0: no longer maintained
Unhandled rejection Error: Command failed: /usr/bin/git submodule update -q --init --recursive
fatal: failed to stat '/root/.npm/_cacache/tmp/git-clone-6cc89af8': Permission denied

    at ChildProcess.exithandler (child_process.js:282:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:957:16)
    at Socket.stream.socket.on (internal/child_process.js:378:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close [as _onclose] (net.js:598:12)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-05-13T21_47_59_583Z-debug.log
davidlares commented 6 years ago

The message is pretty clear, but even running the npm command on root, still getting the problem. One quick fix is executing the same command but with the sudo before the npm

sudo npm install -g learnyounode

It worked for me.

Grenadingue commented 6 years ago

@davidlares I don't understand how you quick fixed it, you're recommending the same command as the OP

On my side I used

mkdir -p /tmp/tuto_node
cd /tmp/tuto_node
npm install learnyounode

then

./node_modules/learnyounode/bin/learnyounode

Note: I've been forced to ^C the npm install and relaunch it because it was stuck

martinheidegger commented 6 years ago

These are not issues with learnyounode, but issues with installing global modules through npm. (this is not learnyounode specific). Thus I am closing this issue. There have been many explanations about this on https://github.com/nodeschool/discussions/issues?q=label%3Ainstallation+is%3Aclosed

Grenadingue commented 6 years ago

Well, for information here is what I found relevant while digging through the given link

https://github.com/nodeschool/discussions/wiki/Installing-global-node-modules-(Linux-and-Mac)