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,450 points
980 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,890 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,220 points
1,226 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,680 points
871 views
0 votes
1 answer

How to use the pipeline setup and deploy the war file using the ansible,docker and kubernettes

Hi@Venkata, You can create an Ansible-Playbook to deploy ...READ MORE

answered Sep 1, 2020 in DevOps on Cloud by MD
• 95,460 points
1,050 views
+3 votes
2 answers
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+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,890 points
742 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP