[英]Missing node_modules when deploying AngularJS2 application to Bluemix
We're trying to deploy an AngularJS2 application to bluemix but we're missing the folder "node_modules" after the application was deployed to the server. 我们正在尝试将AngularJS2应用程序部署到bluemix,但是在将应用程序部署到服务器之后,我们缺少了文件夹“ node_modules”。 We're using npm to build the application.
我们正在使用npm来构建应用程序。
I found the following post that is mentioning the problem: ( https://developer.ibm.com/answers/questions/181207/npm-install-within-subdirectory-not-creating-node.html ) 我发现以下提到该问题的帖子:( https://developer.ibm.com/answers/questions/181207/npm-install-within-subdirectory-not-creating-node.html )
My question would now be: what's the recommended best practice? 我的问题现在是:建议的最佳做法是什么?
I believe you are installing the node modules using npm install
, you also should save those module in your package.json
file which you can do that by npm install --save
. 我相信您正在使用
npm install
安装节点模块,还应该将那些模块保存在package.json
文件中,您可以通过npm install --save
。
The recommended best practice would be to Setup a Build Pipeline . 建议的最佳做法是设置构建管道 。
There could be 3 stages or more: 可能存在3个或更多阶段:
npm install
there so your folder node_modules
gets created for you. npm install
,以便为您创建文件夹node_modules
。 npm test
would run all the tests in your app npm test
将在您的应用程序中运行所有测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.