最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - npm Error: Cannot find module '.clivalidate-engines.js' - Stack Overflow

programmeradmin1浏览0评论

I already have Node.js installed on my device, today in the morning I started a new project with Typescript but found an error when trying to run app.ts, ran the command npm cache clean --force npm uninstall -g npm, but after that it is impossible to use npm, I run node -v and got the expected Node version but when i run npm -v i got this mesage:

node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module './cli/validate-engines.js'
Require stack:
- C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\lib\cli.js:9:25)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\elmer\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\elmer\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

Node.js v22.14.0
PS C:\Users\elmer\PycharmProjects\library> npm cache clean --force
node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module './cli/validate-engines.js'
Require stack:
- C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function._load (node:internal/modules/cjs/loader:1055:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (C:\Users\elmer\AppData\Roaming\npm\node_modules\npm\lib\cli.js:9:25)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\elmer\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\elmer\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

Node.js v22.14.0

Initially I had version 20 of Node I uninstalled it, and install version 20 but the problem persist the same, does any body had experienced this problem before, please I need help with that.

发布评论

评论列表(0)

  1. 暂无评论