简体   繁体   中英

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. We're using npm to build the application.

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 )

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 .

The recommended best practice would be to Setup a Build Pipeline .

There could be 3 stages or more:

  • Build Stage: It builds the app so doing things like npm install there so your folder node_modules gets created for you.
  • Test Stage: Tests the app so doing things like npm test would run all the tests in your app
  • Deploy Stage: Once build and deploy stage runs successfully, Deploy will actually deploy the app to the Bluemix domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM