:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module '../../package.json'
Require stack:
- C:UsersS.Mohammed JunaithAppDataRoamingnpmnode_modulesnpmlibclivalidate-engines.js
- C:UsersS.Mohammed JunaithAppDataRoamingnpmnode_modulesnpmlibcli.js
- C:UsersS.Mohammed JunaithAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (C:UsersS.Mohammed JunaithAppDataRoamingnpmnode_modulesnpmlibclivalidate-engines.js:8:49)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\S.Mohammed Junaith\AppData\Roaming\npm\node_modules\npm\lib\cli\validate-engines.js',
'C:\Users\S.Mohammed Junaith\AppData\Roaming\npm\node_modules\npm\lib\cli.js',
'C:\Users\S.Mohammed Junaith\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
]
}
Node.js v20.16.0
I cannot use the npm
command.
I got this issue when I was updating the npm
$ npm install -g [email protected]
The after I cannot use the npm.
Here is the image
The thing is that I cannot use the npm
I cannot install, update, init, or whatever with npm
. I can’t just use npm
I tried by uninstalling and reinstalling the node.js for three times and also updated the node.js.
But no use.
$node app.js
works perfect.
please help me. I cannot solve the issue. It has been 2 days.
I am using windows 11.
Juanith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.