部署也需要node.js的Ruby on Rails应用

时间:2019-01-25 18:29:14

标签: ruby-on-rails node.js amazon-elastic-beanstalk nvm

我正在尝试通过弹性beantalk在AWS上的Rails应用程序上安装ruby(最终目标是零停机部署),但是我在运行“ AppDeployPreHook / 11_asset_compilation.sh”步骤时遇到错误

我已选择带乘客的ruby平台,并在到达下一步时在AppDeployPreHook / 11_asset_compilation.sh步骤中选择

> @ build:client /var/app/ondeck/client
> npm run ensure-node-version && webpack --config webpack.client.config.js

我收到以下错误代码

  npm ERR! Linux 4.14.88-72.76.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/node" "/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/npm" "run" "ensure-node-version"
  npm ERR! node v4.6.0
  npm ERR! npm  v2.15.9
  npm ERR! file sh
  npm ERR! code ELIFECYCLE
  npm ERR! errno ENOENT
  npm ERR! syscall spawn
  npm ERR! @ ensure-node-version: `check-node-version --package`
  npm ERR! spawn ENOENT
  npm ERR!
  npm ERR! Failed at the @ ensure-node-version script 'check-node-version --package'.
  npm ERR! This is most likely a problem with the  package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     check-node-version --package
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!
  npm ERR!     npm owner ls
  npm ERR! There is likely additional logging output above.

  npm ERR! Please include the following file with any support request:
  npm ERR!     /var/app/ondeck/client/npm-debug.log

  npm ERR! Linux 4.14.88-72.76.amzn1.x86_64
  npm ERR! argv "/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/node" "/usr/bin/npm" "run" "build:client"
  npm ERR! node v4.6.0
  npm ERR! npm  v2.15.9
  npm ERR! code ELIFECYCLE
  npm ERR! @ build:client: `npm run ensure-node-version && webpack --config webpack.client.config.js`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the @ build:client script 'npm run ensure-node-version && webpack --config webpack.client.config.js'.
  npm ERR! This is most likely a problem with the  package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     npm run ensure-node-version && webpack --config webpack.client.config.js
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!
  npm ERR!     npm owner ls
  npm ERR! There is likely additional logging output above.

我已经尝试在执行此脚本之前安装并设置npm

  v7.8.0 is already installed.
  Now using node v7.8.0 (npm v4.2.0)
  Now using node v7.8.0 (npm v4.2.0)

但是由于某些未知原因,node和npm的版本会在下一个任务中重置

到目前为止,我已经尝试过所有可能想到的可能的解决方案,但尚未设法解决。

在这方面的任何帮助都会真的有帮助

0 个答案:

没有答案