Cannot read property 'resolve' of undefined
node -v
v10.16.0
npm -v
6.9.0
commad
npm install -g hexo-cli from https://hexo.io/docs/
platform
windows 1903 18362.145 with Windows PowerShell
log
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Software\\nodejs\\node.exe',
1 verbose cli 'D:\\Software\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'hexo-cli' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 63fbe32fbd21f92e
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for hexo-cli@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 (D:\Software\nodejs\node_modules\npm\node_modules\npm-registry-fetch\index.js:76:23)
10 verbose stack at fetchPackument (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:42:10)
10 verbose stack at packument (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\packument.js:20:10)
10 verbose stack at getManifest (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:22:10)
10 verbose stack at manifest (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\manifest.js:13:10)
10 verbose stack at Object.manifest (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\index.js:17:12)
10 verbose stack at Object.Fetcher#manifest [as manifest] (D:\Software\nodejs\node_modules\npm\node_modules\genfun\lib\genfun.js:15:38)
10 verbose stack at manifest (D:\Software\nodejs\node_modules\npm\node_modules\pacote\lib\fetch.js:23:18)
10 verbose stack at pinflight (D:\Software\nodejs\node_modules\npm\node_modules\pacote\manifest.js:24:12)
10 verbose stack at D:\Software\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:29:24
10 verbose stack at Promise._execute (D:\Software\nodejs\node_modules\npm\node_modules\bluebird\js\release\debuggability.js:313:9)
10 verbose stack at Promise._resolveFromExecutor (D:\Software\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:483:18)
10 verbose stack at new Promise (D:\Software\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:79:10)
10 verbose stack at _inflight (D:\Software\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:28:25)
10 verbose stack at D:\Software\nodejs\node_modules\npm\node_modules\promise-inflight\inflight.js:22:14
10 verbose stack at tryCatcher (D:\Software\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
11 verbose cwd D:\Blog
12 verbose Windows_NT 10.0.18362
13 verbose argv "D:\\Software\\nodejs\\node.exe" "D:\\Software\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "hexo-cli"
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 ]
Same issue with node 10.16.0 to 12.4.0 on MacOS(installed node and npm through n latest). Works fine with 10.6.0 though!
Re installing latest npm using the command curl -L https://www.npmjs.com/install.sh | sh fixes the issue in MacOS 🎉
on windows a similar situation, rolled back to 6.8.0, there is no such problem.
Re installing latest
npmusing the commandcurl -L https://www.npmjs.com/install.sh | shfixes the issue in MacOS 🎉
thx a lot, I rolled nodejs back to v8.16, and it works fine.
Yo igual tenía problemas con la versión de Windows e instale esta versión y se solucionó el problema Windows 64-bit Installer: https://nodejs.org/dist/v10.15.3/node-v10.15.3-x64.msi
is it the official recommendation to downgrade to 10.15 for windows?
I downgraded to 10.15 and it worked
Downgrade works for me (node 10.15)! (in Windows 7)
God save me!
I have same error and node downgraded to 10.15.3 and works!
Detail info
- Windows 10.0.18362.207
- node 12.5.0
- npm 6.9.0
Do not works any command "npm i xxx" and got this error
TypeError: Cannot read property 'resolve' of undefined
I don't believe. I f**** my build server because this version!
Thanks to @jongfeel for his tip installing following fixed the problem; https://nodejs.org/download/release/v10.15.3/
All Releases: https://nodejs.org/en/download/releases/
I too has the same problem, downgraded to Node 10.15.0 work for me.
i resolve it with curl -L https://www.npmjs.com/install.sh |sodu sh
this was happening to me as well but I was using the n package manager
what I did to solve it was downgrade my node version to an old version where npm doesn't throw a tantrum and install the latest version of n, after that all was good
npm i -g n@latest
version 12.6.0 worked for me
What solved it for me (Windows 10) was to install the 32 bit of 10.16.3 version.
I'm also having the same problem, installed the 10.15.3 version of node js and problem got solved...
Downgrading from 10.16.3 to 10.15.3 fixed things for me. Even the 12.3 LTS version didn't work.
I'm using n and switching node from 10.16.3 to 10.15.0 works for me:
n 10.15.0
I am too experiencing this on Windows. Downgraded to 10.15.0 and it seems to work just fine.