我想在 elastic beanstalk 上运行 node.js 应用程序。我有一个客户端,它是通过繁琐的工作(jade、less、concat 等)构建的,我从 git 中排除了这个文件夹
我可以在本地运行这个grunt buildClient
这是由执行的grunt-cli
I added grunt
and grunt-cli
在我的包裹里dev-dependencies
我想在应用程序启动之前运行 grunt 构建,我已经在中设置了配置.ebextensions/app.config
container_commands:
01_build_client:
command: grunt buildClient
我想我的cwd是/tmp/deployment/application/
但有说Fatal error: Unable to find local grunt
。我猜grunt-cli已经安装了,但是为什么会出现这个错误呢?
我也尝试将繁重的工作放在postinstall
的部分package.json
,但这也不起作用。
如何在 EBS 实例上构建我的繁琐作业?
在 paas 上运行 Grunt 时,最好在项目本地安装 grunt-cli 和 grunt 的本地副本。这样它就始终可用并且是您需要的确切版本。然后你跑npm install
代替grunt
所以你的postinstall
工作正常。
例如,您的package.json
可能看起来像这样:
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)