[英]Why I get an error when I try to deploy a react app to GitHub Pages?
I tried to deploy a react app to GitHub pages...我试图将反应应用程序部署到 GitHub 页面...
Commands on package.json: package.json 上的命令:
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
and received this error:并收到此错误:
The "file" argument must be of type string. Received type undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It was supposed to deploy.它应该部署。
I've resolved mine.我的已经解决了Newer version 2.1 has some issue.较新的 2.1 版有一些问题。 Revert back to 2.0.1.恢复到 2.0.1。
npm uninstall gh-pages
npm i gh-pages@2.0.1
npm run deploy // as usual
Hope that helped.希望有所帮助。 :) :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.