繁体   English   中英

将React App部署到github页面

[英]Deploying react app to github pages

我正在尝试将React.js应用程序部署到github页面(我正在遵循本指南https://medium.freecodecamp.com/surge-vs-github-pages-deploying-a-create-react-app-project -c0ecbf317089 ),但是当我运行npm run deploy时,我一直收到以下错误

ENOENT: no such file or directory, stat '/Users/name/Documents/Web Dev/100 Web Projects/wikipediaviewer/build'

npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! wikipediaviewer@1.0.0 deploy: `npm run build&&gh-pages -d build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wikipediaviewer@1.0.0 deploy script 'npm run build&&gh-pages -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 wikipediaviewer 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 wikipediaviewer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls wikipediaviewer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/name/Documents/Web Dev/100 Web Projects/wikipediaviewer/npm-debug.log

谁能帮助我找出我做错了什么? 如果我运行npm run build,它将成功构建。 我也没有使用create-react-app来构建这个应用程序,这可能是问题以及我该怎么解决。

看来您在运行npm run build之后没有创建build文件夹,因此您应该更改gh-pages -d path-to-your-build

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM