繁体   English   中英

ElasticBeanstalk-容器命令Webpack构建错误

ElasticBeanstalk - Container Command Webpack Build Error

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文繁体   英文版本   中英对照 版本,有任何建议请联系yoyou2525@163.com。

我正在尝试将我的webpack构建命令从必须运行到推送到仓库并部署到服务器之前迁移到让Elasticbeanstalk扩展运行容器命令。 我以为简单地添加一个带有npm run build的eb扩展npm run build生成此扩展名,而不会像在本地环境中那样出现任何问题,但是我收到以下错误消息:

 Command execution failed: Activity failed. (ElasticBeanstalk::ActivityFatalError)
caused by: 
  > app@0.5.0 build /tmp/deployment/application
  > webpack


  npm ERR! Linux 4.14.47-56.37.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/bin/node" "/bin/npm" "run" "build"
  npm ERR! node v6.14.3
  npm ERR! npm  v3.10.10
  npm ERR! file sh
  npm ERR! path sh
  npm ERR! code ELIFECYCLE
  npm ERR! errno ENOENT
  npm ERR! syscall spawn sh
  npm ERR! app@0.5.0 build: `webpack`
  npm ERR! spawn sh ENOENT
  npm ERR!
  npm ERR! Failed at the app@0.5.0 build script 'webpack'.
  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 app package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     webpack
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs app
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!     npm owner ls app
  npm ERR! There is likely additional logging output above.
  npm ERR! Linux 4.14.47-56.37.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.14.3-linux-x64/bin/node" "/bin/npm" "run" "build"
  npm ERR! node v6.14.3
  npm ERR! npm  v3.10.10
  npm ERR! code ELIFECYCLE

这是弹性beanstalk配置文件:

container_commands:
  00_npm_build:
    command: "sudo npm run build"

config.json脚本部分:

 "main": "app.js",
  "scripts": {
    "start": "node app.js",
    "build": "webpack",
    "test": "echo \"Error: no test specified\" && exit 1",
    "sql": "./node_modules/sequelize-cli/lib/sequelize",
    "sql:migrate": "npm run sql db:migrate"
  },

和webpack配置:

module.exports = {
    entry: "./public/index.js",
    output: {
        path: __dirname + "/dist",
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {   
                test: /\.js$/, 
                exclude: /node_modules/, 
                loader: "babel-loader"
            },
            {   
                test: /\.jsx$/, 
                exclude: /node_modules/, 
                loader: "babel-loader"
            }
        ]
    },
};
1 个回复

这些都不起作用,我只是做了:

-in EBS config中,我将Node命令设置为npm start

-在package.json中:

"scripts": {
  ...

  "start": "npx sequelize-cli db:migrate && node index.js"
},
9 Elastic Bean Stalk-无法添加用户

我正在尝试将芹菜服务添加到弹性豆秆环境中。 因此,我决定创建第一个用户和组“ celery”。 我按照http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-users ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2021 STACKOOM.COM