Intro
Greetings, all!
I'm on a dual boot system where Node, NPM, and the like worked well in Windows 7, but since Win7 has stopped booting - perhaps due to hardware problems - that leaves Windows 10.
Every time I try using npm install (or some variant, like npm i -g), I get an error at least similar to what is listed below. This has prevented me from using npm i to get the newest npm.
I have tried finding and deleting package.json, but I'm unsure which package.json to remove. There was one in C:\\users\\\\ but that has since been deleted. Moving or deleting node_modules from my node or npm directory hasn't fixed the problem.
I've tried checking the Internet for various solutions to this problem, including installing the latest NodeJS.
Versions
Obtained via node -v and npm -v.
Node: 10.16
NPM: 6.9
This is the log which displays upon running npm i -g npm.
0 info it worked if it ends with ok
1 verbose cli [ 'F:\\NodeJS\\node.exe',
1 verbose cli 'F:\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'i',
1 verbose cli 'npm',
1 verbose cli '-g' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose npm-session c2c7a7280bf360c8
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for npm@latest Cannot read property 'resolve' of undefined
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 32ms
10 verbose stack TypeError: Cannot read property 'resolve' of undefined
10 verbose stack at regFetch (F:\NodeJS\node_modules\npm\node_modules\npm-registry-fetch\index.js:76:23)
10 verbose stack at fetchPackument (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:42:10)
10 verbose stack at packument (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:20:10)
10 verbose stack at getManifest (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:22:10)
10 verbose stack at manifest (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:13:10)
10 verbose stack at Object.manifest (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetchers\registry\index.js:17:12)
10 verbose stack at Object.Fetcher#manifest [as manifest] (F:\NodeJS\node_modules\npm\node_modules\genfun\lib\genfun.js:15:38)
10 verbose stack at manifest (F:\NodeJS\node_modules\npm\node_modules\pacote\lib\fetch.js:23:18)
10 verbose stack at pinflight (F:\NodeJS\node_modules\npm\node_modules\pacote\manifest.js:24:12)
10 verbose stack at F:\NodeJS\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
10 verbose stack at Promise._execute (F:\NodeJS\node_modules\npm\node_modules\bluebird\js\release\debuggability.js:313:9)
10 verbose stack at Promise._resolveFromExecutor (F:\NodeJS\node_modules\npm\node_modules\bluebird\js\release\promise.js:483:18)
10 verbose stack at new Promise (F:\NodeJS\node_modules\npm\node_modules\bluebird\js\release\promise.js:79:10)
10 verbose stack at _inflight (F:\NodeJS\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
10 verbose stack at F:\NodeJS\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
10 verbose stack at tryCatcher (F:\NodeJS\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose cwd C:\Users\Gec
12 verbose Windows_NT 10.0.17134
13 verbose argv "F:\\NodeJS\\node.exe" "F:\\NodeJS\\node_modules\\npm\\bin\\npm-cli.js" "i" "npm" "-g"
14 verbose node v10.16.0
15 verbose npm v6.9.0
16 error Cannot read property 'resolve' of undefined
17 verbose exit [ 1, true ]
I had the same problem with nodejs
10.16.0 (Windows x64 version) and npm
6.9.0. After uninstalling and downgrading to nodejs
10.15.3 and npm
6.4.1 npm i
seems to work correctly again.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.