3

Running npm update --depth=9999 or npm outdated --depth=9999 skips local path dependencies.

I assumed they would act as any other published packages.

We run commands from the root of monorepo:

@org/
  app/
    package.json
package.json
package-lock.json
package.json

"dependencies": {
  "@org/app": "file:@org/app"
},
"devDependencies": {
  "prettier": "^1.16.3",
}
@org/app/package.json

"dependencies": {
  "react": "^16.8.0"
}

Also, when running npm outdated from sub-package dir, NPM does not use root node_modules.

Package                Current   Wanted   Latest  Location
react                  MISSING   16.8.0   16.8.1  @org/app

I've found similar questions: 1, 2

  • running npm i is not a solution since we're using package-lock
  • I want to keep dependencies in sub-packages, not in root package.json

Am I doing something wrong, or it is not supported at the moment and should just use something like npm-check?

npm-check can not update sub-dependencies, so to make a complete update of the whole dependency tree we need to:

  • rm package-lock
  • rm -rf node_modules
  • npm cache clean
  • change versions by hand in root and sub-packages
  • npm i
  • commit new package-lock

Is this correct or is there a better way to handle this?

Luka
  • 389
  • 1
  • 4
  • 10
  • Does this answer your question? [Update local file dependency with npm](https://stackoverflow.com/questions/32873867/update-local-file-dependency-with-npm) – Inigo May 22 '20 at 19:07

0 Answers0