当我运行 npm start 时它工作但 npm run deploy (Github) 抛出错误

时间:2021-06-23 13:15:48

标签: reactjs npm

我在 Sandbox 上创建了一个现有的 React 项目,现在已下载,我正在尝试在 Github 页面上打开它。我按照以下步骤在本地主机中打开它:

  1. 在 VS 上下载 zip 并打开文件夹

在终端

  1. cd keeper-app-test
  2. npm 安装
  3. npm 启动

一切正常并开始。然后我将它与 Github 连接起来的步骤是 - 按照 this guide:

  1. 在 GitHub 上创建一个空仓库
  2. 将 gh-pages 包安装为应用的“开发依赖项”。
  3. 向应用的 package.json 文件添加属性。
  4. 在应用程序的文件夹中创建一个 git 存储库
  5. 将 GitHub 存储库添加为本地 git 存储库中的“远程”
  6. 生成应用的生产版本,并将其部署到 GitHub Pages

在 9 点,我运行 npm run deploy,它抛出以下错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! using-pre-built-react-components-completed@1.0.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the using-pre-built-react-components-completed@1.0.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!     /Users/MacBookAir/.npm/_logs/2021-06-23T13_14_26_506Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! using-pre-built-react-components-completed@1.0.0 predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the using-pre-built-react-components-completed@1.0.0 predeploy 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!     /Users/MacBookAir/.npm/_logs/2021-06-23T13_14_26_541Z-debug.log

我做错了什么?

0 个答案:

没有答案