无法运行npm运行构建/部署

时间:2019-07-04 13:34:59

标签: reactjs git github-pages

我正在尝试部署我的应用程序,但无法正常工作。 我的package.json脚本:

"scripts": {
"serve": "live-server public --port=8091",
"build": "webpack",
"dev-server": "webpack-dev-server",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"

当我运行npm run deploy时出错:

ENOENT: no such file or directory, stat 'C:\Users\Luiz\Desktop\udemy\react-course-projects\indecision-app\build'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! indecision-app@1.0.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the indecision-app@1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

1 个答案:

答案 0 :(得分:0)

你必须包括,你的 github 页面链接也作为主页属性。

像这样 "homepage": "<link of you github page for this project>"

示例: "homepage": "https://hsnice16.github.io/4kids/"