In my project I’ve installed a npm package that I’ve created, and was hoping that npm would specify specify the caret (^) on the package version in package, since I thought it was the default behaviour. However, in the
package.json I had something like
myPkg: 0.0.8, which I then overwritten to
myPkg: ^0.0.8. With this, I thought I would be able to keep making changes and publishing the package and then just use
npm i to update it on the project where I’m using it. However, when I do it, the package’s version remains the same. I tried
npm update and
npm install -P myPkg@latest but none of them worked and they even changed the version on the
package.json back to no-caret.
The strangest thing is that when I do
npm outdated it shows that the latest version is
0.0.9 and the wanted is
0.0.8, even when I have the caret specified on the package.json. What is causing this?