NPM 无法读取未定义的属性“0" [英] NPM Cannot read property '0' of undefined

查看:66
本文介绍了NPM 无法读取未定义的属性“0"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新 Node(最高 v8.6.0)和 npm(最高 v5.5.1)后,我无法执行命令 npm install.npm install 后,我收到错误消息:

After updated Node (upto v8.6.0) and npm (upto v5.5.1) I cannot execute command npm install. After npm install I've error message:

npm ERR! Cannot read property '0' of undefined

有什么问题或者我需要降级 node/npm 吗?

What's trouble or I need downgrade node/npm ?

推荐答案

我做了一些测试:

nodejs@8.6.0 npm@5.5.1 - 我有问题,测试失败

I've made some tests:

nodejs@8.6.0 npm@5.5.1 - I have trouble and the test fails

nvm use 8.5.0

nodejs@8.5.0 npm@5.5.1 - 我有问题,测试失败

nodejs@8.5.0 npm@5.5.1 - I have trouble and the test fails

nvm use 8.4.0

nodejs@8.4.0 npm@5.5.1 - 我有问题,测试失败

nodejs@8.4.0 npm@5.5.1 - I have trouble and the test fails

npm install npm@^5 -g

nodejs@8.4.0 npm@5.4.2 - 我有问题,测试失败

nodejs@8.4.0 npm@5.4.2 - I have trouble and the test fails

nvm use 8.6.0
npm install npm@^4 -g

nodejs@8.6.0 npm@4.6.1 - 没问题,这解决了.

nodejs@8.6.0 npm@4.6.1 - no trouble, this fixes it.

这篇关于NPM 无法读取未定义的属性“0"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆