【问题标题】:Error while npm run deploy of hello world reactJSnpm run deploy hello world reactJS 时出错
【发布时间】:2021-05-20 07:41:16
【问题描述】:

在 npm run deploy 后出现上述错误 代码编辑器终端ERR中的错误日志:code ELIFCYCLE

'gh-pages' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hello-world-4@0.1.0 deploy: `npm run build&&gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello-world-4@0.1.0 deploy script 'npm run build&&gh-page
s -d build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hello-world-4 package
,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build&&gh-pages -d build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hello-world-4
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hello-world-4
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jan\AppData\Roaming\npm-cache\_logs\2017-05-12T17_55_00_56
9Z-debug.log

【问题讨论】:

    标签: reactjs jsx


    【解决方案1】:

    此错误是由于未正确安装 gh-pages。所以要清楚,只需使用以下几行:-

    npm install --save gh-pages 

    所以现在再试一次 npm run deploy

    编码愉快!

    【讨论】:

      猜你喜欢
      • 2017-10-18
      • 2020-06-15
      • 1970-01-01
      • 2021-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多