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

javascript - Node 18 cannot find NPM and Cannot find module '.es6validate-engines.js' - Stack Overflow

programmeradmin1浏览0评论

I have tried to install Nodejs previously also but this time I am unable to access the npm pakage. After installing Nodejs I am able to get the version for NodeJs but when i do Npm -v or I try to create/download any pakage of NPM it gives me

On typing node -v its giving me the version of the node installed but when type npm -v it is giving

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

Error: Cannot find module './es6/validate-engines.js'
Require stack:
- C:\Users\Sathya Kumar S\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\Sathya Kumar S\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
←[90m    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:922:27)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1143:19)←[39m
←[90m    at require (node:internal/modules/cjs/helpers:110:18)←[39m
    at Object.<anonymous> ←[90m(C:\Users\Sathya Kumar S\←[39mAppData\Roaming\npm\node_modules\←[4mnpm←[24m\lib\cli.js:1:25←[90m)←[39m
←[90m    at Module._pile (node:internal/modules/cjs/loader:1256:14)←[39m
←[90m    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:1119:32)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:960:12)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1143:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\Sathya Kumar S\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js'←[39m,
    ←[32m'C:\\Users\\Sathya Kumar S\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'←[39m
  ]
}

Node.js v18.16.1

I tried uninstalling and Installing Node 5-6 times it's Not Working. Any help will appreciate. Thanks edit :- I am using windows 10

I have tried to install Nodejs previously also but this time I am unable to access the npm pakage. After installing Nodejs I am able to get the version for NodeJs but when i do Npm -v or I try to create/download any pakage of NPM it gives me

On typing node -v its giving me the version of the node installed but when type npm -v it is giving

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

Error: Cannot find module './es6/validate-engines.js'
Require stack:
- C:\Users\Sathya Kumar S\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\Sathya Kumar S\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
←[90m    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:922:27)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1143:19)←[39m
←[90m    at require (node:internal/modules/cjs/helpers:110:18)←[39m
    at Object.<anonymous> ←[90m(C:\Users\Sathya Kumar S\←[39mAppData\Roaming\npm\node_modules\←[4mnpm←[24m\lib\cli.js:1:25←[90m)←[39m
←[90m    at Module._pile (node:internal/modules/cjs/loader:1256:14)←[39m
←[90m    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:1119:32)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:960:12)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1143:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\Sathya Kumar S\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js'←[39m,
    ←[32m'C:\\Users\\Sathya Kumar S\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'←[39m
  ]
}

Node.js v18.16.1

I tried uninstalling and Installing Node 5-6 times it's Not Working. Any help will appreciate. Thanks edit :- I am using windows 10

Share Improve this question edited Jun 30, 2023 at 17:27 Rakshit Sathyakumar asked Jun 30, 2023 at 15:41 Rakshit SathyakumarRakshit Sathyakumar 331 silver badge5 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 7

I found the error I have gone through this.

Step one:
press windows + R

Step two:
Type- %AppData%, then go to Roaming inside it you will find NPM file delete it if you have NPM cache delete it also now.

Step three:
If you have already deleted nodejs and re installed it then no problem or better delete nodejs and reinstall

Step four:
Type- npm install -g npm@latest

It will work 100%

I had a similar issue and I solved it with the following steps:

  • I uninstalled node.js
  • I opened " C:\Users\user name\AppData\Roaming\npm"
  • I deleted the whole 'npm' folder
  • Reinstalled node.js

After this when entering "npm -v" in the cmd no error was raised

Hope I helped

发布评论

评论列表(0)

  1. 暂无评论