npm ERR!无法读取未定义的属性“ 0”

时间:2019-09-24 06:28:13

标签: node.js npm nvm

λ npm i
npm ERR! Cannot read property '0' of undefined

我检查了所有类似的问题,例如this one等。到目前为止,我已经尝试过:

  1. 删除node_modules文件夹和package-lock.json,然后删除npm i
  2. 在步骤1中重复删除文件夹和文件+用npm cache clear --force清除缓存
  3. nvm uninstall 10.13.0,重新安装版本
  4. 卸载nvm并重新安装nvm

在此期间,我多次重启了PC。我正在处理公司项目,因此无法降级Node版本。

这是我的NPM日志:

3782 silly saveTree `-- websocket@1.0.29 3783 verbose stack TypeError:
 Cannot read property '0' of undefined 3783 verbose stack     at
 rmStuff (C:\tools\nvm\v10.13.0\node_modules\npm\lib\unbuild.js:61:24)
 3783 verbose stack     at tryCatcher
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
 3783 verbose stack     at ret (eval at makeNodePromisifiedEval
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promisify.js:184:12),
 <anonymous>:13:39) 3783 verbose stack     at lifecycle.then.then
 (C:\tools\nvm\v10.13.0\node_modules\npm\lib\install\action\unbuild.js:12:12)
 3783 verbose stack     at tryCatcher
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
 3783 verbose stack     at Promise._settlePromiseFromHandler
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
 3783 verbose stack     at Promise._settlePromise
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
 3783 verbose stack     at Promise._settlePromise0
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
 3783 verbose stack     at Promise._settlePromises
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
 3783 verbose stack     at Promise._fulfill
 (C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
 3783 verbose stack     at
 C:\tools\nvm\v10.13.0\node_modules\npm\node_modules\bluebird\js\release\nodeback.js:42:21
 3784 verbose cwd C:\src\agl-bot-alfie\botkit 3785 verbose Windows_NT
10.0.17134 3786 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
 3787 verbose node v10.13.0 3788 verbose npm  v6.4.1 3789 error Cannot
 read property '0' of undefined 3790 verbose exit [ 1, true ]

0 个答案:

没有答案