bash - 安装 npm 包时出错 npm ERR!代码生命周期
问题描述
不知道发生了什么,但我收到以下错误
>npx create-react-app .
>npm i <packages>
>npm install
依此类推,所以上面的命令都不起作用
错误:
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Program Files\git\bin\bash.exe
npm ERR! file C:\Program Files\git\bin\bash.exe
npm ERR! path C:\Program Files\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! core-js@2.6.11 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn C:\Program Files\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the core-js@2.6.11 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我已经看到这主要是 Windows 问题,但我使用 Mac
解决方案
https://github.com/facebook/create-react-app/issues/8441这可能对您有所帮助。可能是因为错误的bash!
推荐阅读
- c# - 索引(ElasticClient.IndexMany())抛出 StackOverflowException
- python - 在 ManyToManyField 中计算喜欢 - django rest 框架
- postgis - 通过外部 Geoserver 连接到本地 PC 中的 postgis 数据库
- android - 为什么更新不存在的 firestore 文档永远不会失败?
- php - 为什么流明不能识别正在发送的字段
- php - 如果列不为空,则更新记录,否则在 laravel 中创建新记录
- swift - SwiftUI MacOS - 设置 NSToolbar 颜色
- android - 如何传递继承Kotlin中另一个类的不同类的可变参数?
- java - 如何使用 OpenCV 检测停车标志?
- javascript - 在 Angular 项目中导入 2 个同名的 JavaScript 函数