0

我有一个基本的 reactjs 应用程序。
我想将它部署到 netlify。要在 netlify 上部署它,我需要先构建它。
但是当我运行npm run build它时会引发以下错误。

我的 npm 版本是 6.14.8。

CI= react-scripts build

'CI' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reminder@0.1.0 build: `CI= react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reminder@0.1.0 build 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!     C:\Users\Amarjeet\AppData\Roaming\npm-cache\_logs\2021-01-17T11_18_13_129Z-debug.log
4

2 回答 2

3

请打开 package.json 请找到 "build": "CI= react-scripts build" 并更改为"build": "react-scripts build",然后再次运行 npm run build 应该没问题

于 2021-01-29T13:14:53.943 回答
0

转到 package.json 文件并将脚本对象从 "build" :"CI= react-scripts build" 更改为 "react-scripts build" ,然后运行命令 npm run build 它会起作用。

于 2022-02-20T10:39:45.833 回答