2

I have integrated npm with visual studio and I can run my project locally as it has all the required dependencies in the node_modules locally.

Now I want to publish this web app to remote server but I don't want to add all the node_modules in to the version control and eventually as a part of publish.

How can I publish my web app to the destination and then run npm install on that machine so that it fetches the node_modules based on my package.json.

Thanks

badal jain
  • 53
  • 4
  • Any news on this? Have you solved your problem? – tenbits Mar 30 '17 at 20:29
  • 1
    Hi Yes, I was able to fix it. I included the nodemodules/** in my project file and have the jenkins run npm install before it builds the project. Once npm install is done, the build process picks up the file created under npm install and ships with other files – badal jain Jun 30 '17 at 22:07
  • Doesn't this mean that you have to then version all the files sitting under the node_modules folder? Isn't that inconvenient, and takes away the point of managing dependencies via NPM? Are you still using this approach? I'm currently facing the same issue and wondering what the best solution here is. – Ciaran Gallagher Mar 02 '18 at 10:00
  • 1
    Also, you can include your solution as an answer to your own question on StackOverflow to help others :) – Ciaran Gallagher Mar 02 '18 at 10:01
  • why do you want to install the whole node modules in your prod? just minify and bundle the files you need and ship them. like gulp. – johnny Jun 08 '18 at 21:47

1 Answers1

0

I was able to fix it. I included the nodemodules/** in my project file and have the jenkins run npm install before it builds the project. Once npm install is done, the build process picks up the file created under npm install and ships with other files

badal jain
  • 53
  • 4