无法读取未定义npm ERR的属性'map'!代码ELIFECYCLE npm ERR! errno 1 fir React Front End / Rails Backend

问题描述 投票:0回答:1

运行npm start时收到此错误消息:

Cannot read property 'map' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

任何人都知道发生了什么事?还是也有任何文档可以读取npm错误日志?

ruby-on-rails ruby reactjs npm
1个回答
0
投票

我也遇到类似的错误,即复制我的一个:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

当我运行的node版本与我用来生成应用程序的版本不同,或者可能是从其他地方克隆而忘记运行npm install时,会发生问题。

修复1:将节点版本更改为与您试图通过节点版本管理器启动服务器的目录中生成应用程序的版本相同的版本。

修复2:确保在要运行的目录中设置了要运行的节点版本,然后单击npm install。您可能需要在新的git分支中执行此操作,直到使其运行,然后合并到master中,因为有时版本确实有所不同,您可能需要手动安装其他软件包(将列出它们)。

修复3:清除并重新开始(可能比修复2更好)。试试:

npm cache clean --force
rm package-lock.json
/bin/rm -rf node_modules/
npm install
© www.soinside.com 2019 - 2024. All rights reserved.