首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AWS -通过npm安装安装保龄球组件

AWS -通过npm安装安装保龄球组件
EN

Stack Overflow用户
提问于 2014-07-16 21:20:45
回答 3查看 8.2K关注 0票数 8

我正在尝试使用git aws.push方法来旋转一个aws.push服务器。

nodejs.sdlc.html

类似于这个解决方案,我试图运行“bower”,尽管我的解决方案有点不同:

https://developer.ibm.com/answers/questions/16594/how-to-install-packages-on-nodejs/

我的实施:

“脚本”:{ "postinstall":"bower“},

这在本地工作很好- npm安装也运行保龄球安装没有问题。当我部署到aws时,npm运行得很好--我知道我的服务器启动很好,因为我可以在日志中看到来自它的消息,但是当我试图启动客户机时,没有一个bower组件已经就位。

我使用的是节点v0.10.26,而且我确信我的本地机器上没有全局安装bower。我已经尝试过在package.json的依赖项部分中使用和不包含bower。

有什么想法吗?提前谢谢。

package.json

代码语言:javascript
复制
{
  "name": "smf",
  "version": "0.1.0",
  "dependencies": {
    "aws-sdk": "~2.0.0-rc.14",
    "base64-js": "0.0.6",
    "bookshelf": "~0.6.10",
    "bower": "*",
    "change-case": "~2.1.1",
    "crypto-js": "~3.1.2-3",
    "geojson": "~0.1.5",
    "handlebars": "~2.0.0-alpha.2",
    "js-base64": "~2.1.5",
    "lodash": "~2.4.1",
    "mathjs": "~0.21.0",
    "minify": "~0.5.1",
    "moment": "~2.6.0",
    "newrelic": "~1.5.3",
    "node-cryptojs-aes": "~0.4.0",
    "node-highcharts": "0.0.2",
    "node-uuid": "~1.4.1",
    "passport": "~0.2.0",
    "passport-http": "~0.2.2",
    "passport-local": "~1.0.0",
    "password-hash": "~1.2.2",
    "pg": "~3.0.3",
    "restify": "~2.7.0",
    "should": "~3.3.1",
    "socket.io": "~0.9.16",
    "sqlite3": "~2.2.3",
    "util": "~0.10.3",
    "when": "~3.1.0"
  },
  "devDependencies": {
    "grunt": "~0.4.2",
    "grunt-contrib-jshint": "^0.10.0",
    "grunt-mocha-test": "~0.9.0",
    "mocha-phantomjs": "~3.3.1"
  },
  "scripts": {
    "postinstall": "bower install -F"
  },
  "engines": {
    "node": ">=0.6"
  }
}

日志文件

整个日志太长了,如果您需要的话,我会将它粘贴到多个注释中。下面是唯一提到保龄球的部分。

如果我试图访问该网站,我可以获得访问日志,表明保龄球组件丢失。

似乎没有任何执行的保龄球安装发生。

/var/log/目录-钩子-Executor.log

Subscore.string@2.3.3 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string esprima@1.0.4 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima对象分配@0.3.1/tmp/部署/应用程序/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign uuid@1.4.1 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid最新版本@0.2.0 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version包-json@0.2.0/tmp/部署/应用程序/节点_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json获得@0.3.0 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got对象-assign@0.3.1 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/object-assign注册表-url@0.1.1 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url npmconf@2.0.2 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_node/npmconf config-chain@1.1.8 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/config-chain proto@1.2.3 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list ini@1.2.1 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini继承@2.0.1 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/inherits mkdirp@0.3.5 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/mkdirp一次性@1.3.0 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/once uid-number@0.0.5 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/uid-number义量器-diff@0.1.0/tmp/部署/application/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff字符串长度@0.1.2 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/string-length条-ansi@0.2.2 /tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi ansi-regex@0.1.0 /tmp//tmp/deployment/application/node_modules/bower/node_modules/update-notifier/node_modules/string-length/application/node_modules/bower/node_modules/update-notifier/node_modules/string-length/node_modules/strip-ansi/node_modules/ansi-regex @1.0.5 /tmp/deployment/application/node_modules/bower/node_modules/which

EN

回答 3

Stack Overflow用户

发布于 2014-09-17 00:14:26

bower可能没有在全球范围内安装(如果是的话,请告诉我如何在弹性豆杆上安装:D )。相反,您应该指向node_modules文件夹中的bower (这是我们以前的做法)。我们已经放弃了这个解决方案(考虑它的规模是500个实例)并将bower_components签入回购程序。

代码语言:javascript
复制
"scripts": {
  "postinstall": "node_modules/bower/bin/bower install -F"
},
票数 6
EN

Stack Overflow用户

发布于 2015-08-27 23:26:41

将.config文件添加到.ebextensions dir以安装bower组件会有所帮助。不幸的是,在默认情况下,节点和npm没有添加到路径中,因此您需要找到最新的节点实例并创建一个符号链接。我真的不喜欢将bower组件作为根安装,但是这样做是可行的:

代码语言:javascript
复制
commands:
  01_get_sudo:
      command: echo Defaults:root \!requiretty >> /etc/sudoers
  02_node_path:
    command: "sudo ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /usr/bin/node"
  03_npm_path:
    command: "sudo ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/npm /usr/bin/npm"

container_commands:
  01_bower_install:
    command: "sudo ./node_modules/bower/bin/bower install --allow-root"
票数 3
EN

Stack Overflow用户

发布于 2016-03-03 03:21:05

使用$NODE_HOME,例如。

代码语言:javascript
复制
container_commands:
  01_bower_install:
    command: "export PATH=$PATH; $NODE_HOME/bin/node ./node_modules/bower/bin/bower install --allow-root &>> /tmp/01_bower_install.log"

head -1不一定使用nodenpm的最新版本。

例如..。

代码语言:javascript
复制
$ ls -td /opt/elasticbeanstalk/node-install/node-* | head -1
/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64

ls显示,v5.6.0实际上是最新的:

代码语言:javascript
复制
$ ls -td /opt/elasticbeanstalk/node-install/node-*
/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64
/opt/elasticbeanstalk/node-install/node-v0.10.42-linux-x64
/opt/elasticbeanstalk/node-install/node-v5.6.0-linux-x64
/opt/elasticbeanstalk/node-install/node-v0.8.28-linux-x64
/opt/elasticbeanstalk/node-install/node-v0.12.10-linux-x64

即使是这样,也可能不是你想要的。

您可以通过排序来解决这个问题,但是您可能仍然希望使用与环境相同的节点版本,这可以通过$NODE_HOME访问。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24790972

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档