Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 10.5.1 broken on upgrade with Error: Cannot find module '@npmcli/config/lib/definitions' #7336

Closed
2 tasks done
jlarmstrongiv opened this issue Apr 3, 2024 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@jlarmstrongiv
Copy link

jlarmstrongiv commented Apr 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Upgrading npm in the package.json from 10.5.0 to 10.5.1 in the engines field, running corepack enable npm, and running npm i throws an error:

/Users/user/.cache/node/corepack/npm/10.5.1/lib/es6/validate-engines.js:31
    throw err
    ^

Error: Cannot find module '@npmcli/config/lib/definitions'
Require stack:
- /Users/user/.cache/node/corepack/npm/10.5.1/lib/npm.js
- /Users/user/.cache/node/corepack/npm/10.5.1/lib/cli-entry.js
- /Users/user/.cache/node/corepack/npm/10.5.1/lib/cli.js
- /Users/user/.cache/node/corepack/npm/10.5.1/bin/npm-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/user/.cache/node/corepack/npm/10.5.1/lib/npm.js:9:46)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/user/.cache/node/corepack/npm/10.5.1/lib/npm.js',
    '/Users/user/.cache/node/corepack/npm/10.5.1/lib/cli-entry.js',
    '/Users/user/.cache/node/corepack/npm/10.5.1/lib/cli.js',
    '/Users/user/.cache/node/corepack/npm/10.5.1/bin/npm-cli.js'
  ]
}

Node.js v20.11.1

Expected Behavior

npm i continues to work as expected without any errors

Steps To Reproduce

  1. Upgrading npm in the package.json from 10.5.0 to 10.5.1 in the engines field
  2. Run corepack enable npm
  3. Run any npm command, like npm i or npm config ls

Environment

  • npm: 10.5.1
  • Node.js: v20.11.1
  • OS Name: MacOS, x86_64, Sonoma
  • System Model Name: MacBook Pro 2019
  • npm config:
; copy and paste output from `npm config ls` here
; npm is broken, cannot run the command
@jlarmstrongiv jlarmstrongiv added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Apr 3, 2024
@jlarmstrongiv
Copy link
Author

Downgrading to 10.5.0 fixes the issue

@jlarmstrongiv
Copy link
Author

Or, upgrading node to 20.12.1 from 20.11.1 fixed the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x
Projects
None yet
Development

No branches or pull requests

1 participant