Many web developers face Node.js issues, and one of the most frustrating is this:
npm –version
node:internal/modules/cjs/loader:1093
throw err;
^
Error: Cannot find module ‘C:Program Filesnodejsnode_modulesnpmbinnode_modulesnpmbinnpm-cli.js’
at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
at Module._load (node:internal/modules/cjs/loader:934:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}
Node.js v19.9.0
how to fix :
**1- **add nodejs to your “C:Program Filesnodejs” in the user and system Environment Variables
2 – try to add new system variable go to Environment Variables–> in system variable section click “New” variable name : nodejs
varuable value : path to your nodejs in the program files example :”C:Program Filesnodejs”
click ok –> ok –> ok
3- if non of the above works try to remove nodejs from every point in your system and install it again , then try to repeat the same things in **1 and 2 **