The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
npm install doesn't install new or updated dependencies of local dependency
What I Wanted to Do
I would like to install/update dependencies in my local dependency and not worry that I have to update package-lock.json in all my projects in monorepo that use this local dependency.
What Happened Instead
New or updated dependencies in local dependency are not installed if these changes are not present in the package-lock.json in project that uses local dependency. Even updated package-lock.json in local dependency doesn’t help, it is ignored.
git clone https://github.com/fresk-nc/npm-local-demo.git cd npm-local-demo/core npm i --save commander cd .. git clean -fdx cd www npm i
There is no problem if there are node_modules in the project, new/updated dependencies will be installed and package-lock.json will be updated.
$ npm --versions 6.9.0 $ node -p process.platform darwin
After following the reproduction steps, I think this shows the issue you are describing?
$ npm ls commander email@example.com /Users/john/Documents/Sandpits/npm.community/7043/npm-local-demo/www └─┬ firstname.lastname@example.org -> /Users/john/Documents/Sandpits/npm.community/7043/npm-local-demo/core └── UNMET DEPENDENCY commander@^2.20.0 $ npm i $ npm ls commander email@example.com /Users/john/Documents/Sandpits/npm.community/7043/npm-local-demo/www └─┬ firstname.lastname@example.org -> /Users/john/Documents/Sandpits/npm.community/7043/npm-local-demo/core └── email@example.com
Yeah right. Thanks for demonstrating.