部署到弹性beantalk的问题“拒绝删除”

时间:2019-01-21 15:41:19

标签: node.js npm amazon-elastic-beanstalk codeship

嗨,我在尝试将新代码部署到我们的测试环境时偶然发现了这个错误,但是突然间它崩溃了。

在我的机器上工作正常,但突然在AWS上崩溃,在部署时崩溃。

eb-activity.log

  npm ERR! path /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp
  npm ERR! code EEXIST
  npm ERR! Refusing to delete /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp: is outside /tmp/deployment/application/node_modules/hummus/node_modules/node-pre-gyp and not a link
  npm ERR! File exists: /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp

深入了解它说的日志

/tmp/.npm/_logs/2019-01-21T12_50_51_067Z-debug.log

624 verbose unbuild rmStuff node-pre-gyp@0.10.3 from /tmp/deployment/application/node_modules
625 verbose unbuild rmStuff in /tmp/deployment/application/node_modules/hummus/node_modules
626 silly isEverInside /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp is not inside /tmp/deployment/application/node_modules/hummus/node_modules/node-pre-gyp
627 silly gentlyRm parent.path = /tmp/deployment/application/node_modules/hummus/node_modules/node-pre-gyp
628 silly gentlyRm parent.managed = /tmp/deployment/application/node_modules/hummus/node_modules/node-pre-gyp is in /tmp/deployment/application
629 silly gentlyRm target.path =  /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp
630 silly gentlyRm target.symlink = null
631 silly gentlyRm target.managed = /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp is in /tmp/deployment/application
632 silly gentlyRm target.inParent =  false
633 verbose unlock done using /tmp/.npm/_locks/staging-6d252812679aa9c6.lock for /tmp/deployment/application/node_modules/.staging
634 verbose stack Error: Refusing to delete /tmp/deployment/application/node_modules/hummus/node_modules/.bin/node-pre-gyp: is outside /tmp/deployment/application/node_modules/hummus/node_modules/node-pre-gyp and not a link

我让CodeShip部署所有代码,这些代码打包node_modules并将其上传到AWS。

但是现在当我尝试进行$ eb deploy DEV-APP --profile dev时,它就可以正常工作。

  > hummus@1.0.95 install /tmp/deployment/application/node_modules/hummus
  > node-pre-gyp install --fallback-to-build $EXTRA_NODE_PRE_GYP_FLAGS

  node-pre-gyp WARN Using request for node-pre-gyp https download
  [hummus] Success: "/tmp/deployment/application/node_modules/hummus/binding/hummus.node" already installed
  Pass --update-binary to reinstall or --build-from-source to recompile

仅当我让CodeShip进行部署时,它根本无法工作。

1 个答案:

答案 0 :(得分:0)

好吧,所以我得出的结论是,我自己的部署并未向CodeShip添加的S3存储桶中添加node_modules

因此,我只是添加了一个部署脚本,以在部署到弹性beantalk之前删除node_modules