npm err Cannot read property '0' of undefined

Having the same issue on npm 5.4.2. Initially I tried npm cache clear --force but it did not resolve my issue. Removing package-lock.json didn't either.

 

Removing both node_modules and package-lock.json worked:

 

rm -rf node_modules/
rm package-lock.json
# Install and add the package I wanted to install in the first place
npm install --save @myorganisation/mypackage
# Reinstall everything else
npm install



来源:https://github.com/npm/npm/issues/18238

修改时间 2018-06-15

声明:本站所有文章和图片,如无特殊说明,均为原创发布,转载请注明出处。
随机推荐
URLSearchParams 对象
如何使主题支持 Woocommerce
Content Security Policy(CSP)简介
WordPress 上传附件
什么是 XSS 攻击
WordPress 函数 add_option()、get_option() 和 update_option()
JavaScript 中 0.1 加 0.2 不等于 0.3 的原因和解决方法
WordPress 函数 get_categories() 获取所有分类