Nodejs version - 14.17.3
npm version - 6.14.13
I am confused over the difference in package versions -
the one I have declared in package.json
is different than
the one that is being installed by npm install
command.
package.json -
{
"name": "training-project-metadata",
"version": "1.0.0",
"description": "",
"main": "module1.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"tildify": "^2.0.0"
},
"bundleDependencies": [
"tildify"
]
}
If I run npm install
command, this is the package-lock.json that is being created -
{
"name": "training-project-metadata",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"tildify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/tildify/-/tildify-3.0.0.tgz",
"integrity": "sha512-9ZLMl75qnTLr7oSEmWJbKemFS/fP4TMBiF6PFwGwLpgobebU1ehXoGbadJ+7jT8fjaz2G82JgN9G4taz+o1j1w==",
"dev": true
}
}
}
I even tried removing ^ symbol from package.json to make it exact version - but that didn't help.
What I have found is if I run this command explicitly - only then the correct version 2.0.0 is installed.
npm install tildify@2.0.0 --save-dev
Can anyone please help me understand why it doesn't work for npm install
command?
Thank you!