Skip to content

NPM 9 update in 18.14.0 broke npm ci with local dependencies #46542

@MattIPv4

Description

@MattIPv4

Version

18.14.0

Platform

Darwin HMTV-Cowley.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64

Subsystem

No response

What steps will reproduce the bug?

Creating package a:

mkdir a
cd a
fnm use 18.13.0 # Or any other tooling to switch Node/NPM version
npm -v # 8.19.3
npm init -y
npm i random
npm ci # Works
fnm use 18.14.0 # Or any other tooling to switch Node/NPM version
npm -v # 9.3.1
npm ci # Works

Creating package b:

mkdir b
cd b
fnm use 18.13.0 # Or any other tooling to switch Node/NPM version
npm -v # 8.19.3
npm init -y
npm i file:../a
npm ci # Works

Triggering npm ci failure:

cd b
fnm use 18.14.0 # Or any other tooling to switch Node/NPM version
npm -v # 9.3.1
npm ci # Fails

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

npm ci doesn't fail

What do you see instead?

npm ERR! code EUSAGE
npm ERR! 
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! 
npm ERR! Missing: [email protected] from lock file
npm ERR! Missing: [email protected] from lock file
npm ERR! 
npm ERR! Clean install a project
npm ERR! 
npm ERR! Usage:
npm ERR! npm ci
npm ERR! 
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--install-strategy <hoisted|nested|shallow>]
npm ERR! [--legacy-bundling] [--global-style]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--no-install-links]
npm ERR! 
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR! 
npm ERR! Run "npm help ci" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mattcowley/.npm/_logs/2023-02-07T13_37_40_247Z-debug-0.log

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    npmIssues and PRs related to the npm client dependency or the npm registry.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions