【发布时间】:2018-10-20 20:39:59
【问题描述】:
我在我的 react 应用程序的客户端安装 npm 模块时遇到问题。由于这个错误,我也无法部署到 Heroku。这是确切的错误:
`npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "node_modules": node_modules is a blacklisted
name
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.BBwm7/_logs/2018-05-10T14_10_45_520Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grecospie@1.0.0 heroku-postbuild: `cd client/ && npm install &&
npm install --only=dev --no-shrinkwrap && npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grecospie@1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.BBwm7/_logs/2018-05-10T14_10_45_552Z-debug.log`
我不确定还需要什么其他信息,因为我不太确定发生了什么,请让我知道我应该添加什么。我的 package.json 中也没有 node_modules 包。
【问题讨论】:
-
通过删除我的 package-lock.json 然后再次尝试 npm install 解决了这个问题。
标签: node.js reactjs npm create-react-app