NPM reports unmet dependency after performing a recursive/deep update
npm --depth 9999 update
npm ls reports a lot of missing/unmet dependencies, for example:
โโโฌ @semantic-release/[email protected]
โ โโโ @semantic-release/[email protected] deduped
โ โโโ [email protected] deduped
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโฌ UNMET DEPENDENCY [email protected]
npm ERR! missing: [email protected], required by @semantic-release/[email protected]
npm initnpm i -D @semantic-release/execnpm --depth 9999 updatepackage.json file of their parent or any npm-shrinkwrap.json of their ancestor.package-lock.json and proceed to resolve all dependencies, install/update/remove as necessary, and then update the lockfile with the resolved tree.
Looks like I've prepared duplicated issue
Command npm update --depth <number> loses dev: true for updated devDependencies dependencies.
npm update --depth <number> for packages with not fresh devDependencies dependenciesIt loses dev: true for updated devDependencies dependencies
loses-dev-for-dev-depsnpm inpm update --depth 7I expect that this action should keep dev: true for updated devDependencies dependencies
Possibly related to #944
I'm also experiencing that npm update forgets the dev flag for the dependencies when --depth is greater than 0. Maybe it is not necessary for lower depth?
I found out that the dev flag is restored after reinstalling the node modules (rm -rf node_modules; npm install)
I see the same issue of loosing the dev flag after using npm update --depth but only for dev dependencies of my project which are real dependencies at an other dependency.
In my case an other dependency adds "@types/node" as dependency but at my project has it as dev dependency:
package.json of dependency "a":
{
name: "a",
dependencies: {
"@types/node": ">=5.10"
}
}
my project:
{
dependencies: {
"a": "1.0.0"
},
devDependencies: {
"@types/node": "^12.0.0",
"somethingElse": "1.0.0"
}
}
after npm update --depth=99 the dev flag is ok for somethingElse but it is wrong for @type/node
edit: npm install seems to store the @types/node as dev dependency at the root + as dependency at nested node_module at component "a".
npm update installes it only once as dependency at root
Most helpful comment
Looks like I've prepared duplicated issue
What / Why
Command
npm update --depth <number>losesdev: truefor updated devDependencies dependencies.When
npm update --depth <number>for packages with not fresh devDependencies dependenciesWhere
How
Current Behavior
It loses
dev: truefor updated devDependencies dependenciesSteps to Reproduce
loses-dev-for-dev-depsnpm inpm update --depth 7Expected Behavior
I expect that this action should keep
dev: truefor updated devDependencies dependenciesReferences
Possibly related to #944