if i delete node_modules folder and after re-creating it, will i get all the already installed packages back in the same way they were just before?
answer is yes.
or you can do it with
npm ci
its faster and do the same job.
but what if problem is with your package-lock?
your team commited package-lock.json and in merge or somehow its not the correct.
here you need to remove package-lock too.
now getting packages same as they were beforedepends on your package.json.
look at this package.json
{
"name": "awesome-app",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"scripts": {
.
.
.
},
"author": "",
"license": "ISC",
"dependencies": {
"angular": "^1.8.1"
},
}
every time i run npm install, because of "^", npm looks for last angular release which match 1.X.X version and update your package to that version.
if we see angular versions on npm website, angular released 1.8.2 one month after 1.8.1 .
so this depends on when you are installing and how did you specify version range.
read more about npm flags
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…