Amazon Elastic Beanstalk npm无法找到package.json

use*_*826 17 amazon-ec2 amazon-web-services node.js amazon-elastic-beanstalk

我是非常新的亚马逊网络服务,我正在尝试在他们的弹性beanstalk上设置node.js应用程序.我设置了实例并上传/部署了站点,但是当运行状况为"Ok"时,node.js日志显示重复约30次:

npm ERR! enoent ENOENT: no such file or directory, open '/var/app/current/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /var/app/current/npm-debug.log
npm ERR! Linux 4.1.13-19.31.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.2.3-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.2.3-linux-x64/bin/npm" "start"
npm ERR! node v4.2.3
npm ERR! npm  v2.14.7
npm ERR! path /var/app/current/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
Run Code Online (Sandbox Code Playgroud)

问题是我的package.json确实存在,因为我使用npm init生成了一个.关于为何无法找到它的任何想法?这是package.json

{
    "name": "testwebsite",
    "version": "0.0.1",
    "scripts": {
        "start": "node server.js"
    },
    "dependencies": {
        "body-parser": "^1.13.3",
        "express": "^4.13.3",
        "express-session": "~1.0.0",
        "socket.io": "^1.3.7"
    },
    "description": "my website",
    "author": "Matt",
    "engines": {
        "node": ">=0.10.0"
    },
    "main": "server.js",
    "devDependencies": {},
    "license": "ISC"
}
Run Code Online (Sandbox Code Playgroud)

ano*_*412 32

从一个正式的AWS线程[1],你可能正在压缩顶级目录而不是压缩源本身.

例如,您可能将所有文件都放在名为"Project"的文件夹中.您应该压缩并上传"项目" 的内容,而不是压缩"项目".

[1] https://forums.aws.amazon.com/thread.jspa?messageID=476022