2017-04-19 5 views
0

Ich bin neu in Docker. Nachdem ich mich mit docker run im Container angemeldet habe und den folgenden Befehl ausgeführt habe, erhalte ich einen Fehler.npm Installationsfehler in Docker Container

[email protected]:/usr/src/svx-frontend$ npm install 


enoent ENOENT: no such file or directory, open '/usr/src/svx-frontend/package.json' 
npm WARN svx-frontend No description 
npm WARN svx-frontend No repository field. 
npm WARN svx-frontend No README data 
npm WARN svx-frontend No license field. 
npm ERR! Linux 4.4.0-42-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" 
npm ERR! node v6.10.2 
npm ERR! npm v3.10.10 
npm ERR! path /usr/src/svx-frontend/node_modules 
npm ERR! code EACCES 
npm ERR! errno -13 
npm ERR! syscall mkdir 

npm ERR! Error: EACCES: permission denied, mkdir '/usr/src/svx-frontend/node_modules' 
npm ERR!  at Error (native) 
npm ERR! { Error: EACCES: permission denied, mkdir '/usr/src/svx-frontend/node_modules' 
npm ERR!  at Error (native) 
npm ERR! errno: -13, 
npm ERR! code: 'EACCES', 
npm ERR! syscall: 'mkdir', 
npm ERR! path: '/usr/src/svx-frontend/node_modules' } 
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 
npm ERR! Linux 4.4.0-42-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" 
npm ERR! node v6.10.2 
npm ERR! npm v3.10.10 
npm ERR! path npm-debug.log.1447058929 
npm ERR! code EACCES 
npm ERR! errno -13 
npm ERR! syscall open 

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.1447058929' 
npm ERR!  at Error (native) 
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.1447058929' 
npm ERR!  at Error (native) 
npm ERR! errno: -13, 
npm ERR! code: 'EACCES', 
npm ERR! syscall: 'open', 
npm ERR! path: 'npm-debug.log.1447058929' } 
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /usr/src/svx-frontend/npm-debug.log 

Antwort

0

Zum Herunterladen und node.js Verwendung commend installieren:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 
sudo apt-get install -y nodejs 

npm Verwendung commend Zum Herunterladen:

curl -L https://www.npmjs.com/install.sh | sh 

Und es läuft.

Ich hoffe, es ist hilfreich

+0

Wenn ich die obigen Befehle ausführen, erfordert es ein Passwort für Ubuntu wie unten. [sudo] Passwort für ubuntu: Nach Eingabe von ubuntu Passwort (auch richtige Passwort), sagt es falsches Passwort wie: sudo: 3 falsche Passwortversuche –

+0

Unter dem vollständigen Befehl und Antwort als Referenz: ubuntu @ e4c4a6ae6c54:/usr/src/svx-frontend $ sudo curl -L npmjs.com/install.sh | sh [sudo] Passwort für ubuntu: Sorry, versuche es noch einmal. [sudo] Passwort für Ubuntu: Sorry, versuche es noch einmal. [sudo] Passwort für Ubuntu: sudo: 3 falsche Passwortversuche ubuntu @ e4c4a6ae6c54:/usr/src/svx-frontend $ –