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

真诚赞赏,手留余香
赞赏
随机推荐
PHP 一次查询生成二维 Json
使用Cordova命令行界面(CLI)
Node.js实现的简单爬虫
CommonJS和AMD
nginx location 配置返回文本
Wordpress 学习笔记 3 数据库表结构
Thinkcmf面包屑
macOS 安装 nginx
jQuery.position()不可靠
索引的选择性