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

声明:本站所有文章和图片,如无特殊说明,均为原创发布,转载请注明出处。
随机推荐
Node.js fs 文件系统模块
MySQL 批量修改时间
CRSF 跨站脚本攻击已死,使用 Same-Site Cookies 来防范 CSRF
JavaScript 滚动浏览器窗口到指定的元素
JavaScript DOM 查找元素
Express 使用 cookie-session 处理 session
WordPress 分类添加自定义字段
Node.js 控制台进度条实现原理