how to safely deploy npm install without it causing inconsistencies?

0 votes
The npm install/ update is causing me problems when deploying them. I am using angular. Firstly, npm install is a stateful operation and depends entirely upon the latest version of dependencies, when the command is executed. The problem is that package.json doesn't indicate a specific version  instead gives the ranges of versions.

Now, this in turn makes things difficult whenever I run npm update or use ncu, because then I have to deal with the inconsistencies between the modules.

Is there any way to have a package.json file that tells me exactly the state of installed packages rather than ranges?
Apr 11, 2018 in DevOps on Cloud by DragonLord999
• 8,380 points
57 views

1 answer to this question.

0 votes

The recent versions on npm generates a package-lock.json file. It keeps the exact version of any package when it was first installed. So whenever you call npm install, it will fetch and install those versions.

Also it is good practice to add these files to your repo, therefore, if anyone is cloning it will get the same dependencies installed.

Here are the npm docs

answered Apr 11, 2018 by DareDev
• 6,810 points

Related Questions In DevOps on Cloud

+2 votes
3 answers

How do I deploy Scala PlayFramework Project to IBM Bluemix

It seems that they are more than ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by lina
• 8,100 points
97 views
0 votes
1 answer

How to deploy compiled elements Azure Web App with Appveyor?

Add the following BeforeBuild target to Web ...READ MORE

answered Jul 12, 2018 in DevOps on Cloud by Kalgi
• 2,620 points
29 views
+3 votes
2 answers
0 votes
1 answer
0 votes
1 answer
+13 votes
2 answers
+1 vote
3 answers
0 votes
1 answer

Is it possible to open a bug in VSTS if release deployment fails?

You can do this by adding another ...READ MORE

answered Apr 24, 2018 in DevOps on Cloud by DareDev
• 6,810 points
54 views