I have an old project I used to run using the 12.16.1 version of Node. My machine was wiped clean, so now when I tried to use npm i
on the 12.16.1 version of Node I get the following error:
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
The problem is that, as far as I’m concerned, my Path is configured the right way. It’s just that the node_modulesnpmbinnpm-cli.js
doesn’t exist on my nodejs
directory. When I change it to the version 18.12.0 of Node I get the path with everything inside, but there are many conflicts with the older packages I’m trying to install, so I’ll have a lot of trouble to fix every single dependency conflict if I try going through that route.
I’ve installed 12.16.1 through nvm install
and have already done nvm uninstall
and installed it again through nvm, but the node_modules
directory is still empty. Any clues to what could be the fix? Running on Windows.