1

Ich versuche, eine Node.js App für Elastic Beanstalk bereitzustellen. Die App funktioniert lokal einwandfrei. Allerdings, wenn ich zu implementieren versuchen, ich den Fehler:AWS EB-Bereitstellungsproblem

Failed to run npm install. Snapshot logs for more details. 

Hier ist ein Screenshot des EB-Protokoll, um Detail: enter image description here

Error Log (Ich fand es interessant, dass ich habe verweigert die Erlaubnis - was könnte das bedeuten):

/var/log/eb-activity.log 
------------------------------------- 
    npm ERR! path /tmp/.npm/node-linux-x64 
    npm ERR! code EACCES 
    npm ERR! errno -13 
    npm ERR! syscall mkdir 

    npm ERR! Error: EACCES: permission denied, mkdir '/tmp/.npm/node-linux-x64' 
    npm ERR!  at Error (native) 
    npm ERR! { Error: EACCES: permission denied, mkdir '/tmp/.npm/node-linux-x64' 
    npm ERR!  at Error (native) 
    npm ERR! errno: -13, 
    npm ERR! code: 'EACCES', 
    npm ERR! syscall: 'mkdir', 
    npm ERR! path: '/tmp/.npm/node-linux-x64', 
    npm ERR! parent: 'node' } 
    npm ERR! 
    npm ERR! Please try running this command again as root/Administrator. 
    npm ERR! Linux 4.9.58-18.55.amzn1.x86_64 
    npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm" "install" "--no-save" "[email protected]" 
    npm ERR! node v6.11.5 
    npm ERR! npm v3.10.10 
    npm ERR! path npm-debug.log.487421323 
    npm ERR! code EACCES 
    npm ERR! errno -13 
    npm ERR! syscall open 

    npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.487421323' 
    npm ERR!  at Error (native) 
    npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.487421323' 
    npm ERR!  at Error (native) 
    npm ERR! errno: -13, 
    npm ERR! code: 'EACCES', 
    npm ERR! syscall: 'open', 
    npm ERR! path: 'npm-debug.log.487421323' } 
    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!  /tmp/deployment/application/node_modules/node/npm-debug.log 
    module.js:471 
     throw err; 
    ^

    Error: Cannot find module 'node-linux-x64/package.json' 
     at Function.Module._resolveFilename (module.js:469:15) 
     at Function.resolve (internal/module.js:27:19) 
     at ChildProcess.<anonymous> (/tmp/deployment/application/node_modules/node-bin-setup/index.js:18:27) 
     at emitTwo (events.js:106:13) 
     at ChildProcess.emit (events.js:191:7) 
     at maybeClose (internal/child_process.js:920:16) 
     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 

    npm ERR! Linux 4.9.58-18.55.amzn1.x86_64 
    npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm" "--production" "rebuild" 
    npm ERR! node v6.11.5 
    npm ERR! npm v3.10.10 
    npm ERR! code ELIFECYCLE 
    npm ERR! [email protected] preinstall: `node installArchSpecificPackage` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] preinstall script 'node installArchSpecificPackage'. 
    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 node package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  node installArchSpecificPackage 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs node 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls node 
    npm ERR! There is likely additional logging output above. 

Package.json:

{ 
    "name": "MyProject", 
    "version": "0.0.1", 
    "private": true, 
    "dependencies": { 
    "body-parser": "latest", 
    "express": "latest", 
    "node": "latest", 
    "nodemailer": "latest" 
    }, 
    "scripts": { 
    "start": "node app.js" 
    } 
} 
?

Warum passiert das?

EDIT: Paket.json und Fehlerprotokoll wie angefordert hinzugefügt.

+2

Was sagen die Protokolldateien? – stdunbar

+0

Bitte posten Sie Ihre 'package.json', zumindest die Skripte Abschnitt –

+1

Bearbeitete meinen Beitrag mit beiden Protokoll und package.json –

Antwort

0

Ohne Informationen zu gehen, hier sind einige Vermutungen:

  • Sie manuell zu zippen und Ihre App hochladen. Use the CLI tools aus irgendeinem Grund eb deploy geht immer glatter
  • Sie befinden sich auf einem sehr kleinen Instanz sind, und Sie müssen eine mit genügend Arbeitsspeicher aktualisieren Sie Ihre Abhängigkeiten zu behandeln

Wenn diese, nicht helfen bitte Ihre package.json veröffentlichen . Oder verwenden Sie einfach Up, es ist so viel einfacher als Beanstalk.

+0

Worum handelt es sich bei diesen CLI-Tools? Ich habe nur Optionen zum manuellen Hochladen von Apps im EB-Bereitstellungsprozess gesehen. –

+0

Hier ist ein Tutorial mit der EB CLI mit Knoten https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html –

+0

Ich habe versucht, mit CLI, und es scheint immer noch nicht zu funktionieren. Ich denke, das Problem besteht hauptsächlich in der EACCS-Berechtigungsverweigerung. –