![](/img/trans.png)
[英]npm run deploy is not working, can't deploy react app to github
[英]I can't deploy react app using npm run deploy
我需要建议来调试 React 站点从 Github 到 Netlify 的部署。
我使用下面的代码进行部署: npm run deploy
这是终端上的错误:
npm ERR! code ELIFECYCLE
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! v1.0.0@0.1.0 deploy: `inhyechoi -d build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the v1.0.0@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
到目前为止我尝试过的:
-uninstall npm -reinstall npm with latest update -remove node modules -install node modules -npm cache clear -npm ci
这是 github 存储库: https : //github.com/inhyechoi/inhyechoi-portfolio/
完整日志:
v1.0.0@0.1.0 deploy /Users/inhyechoi/Desktop/InhyeChoi/react/portfolio/inhyechoi-portfolio-react
inhyechoi -d build
sh: inhyechoi: command not found
npm ERR! code ELIFECYCLE
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! v1.0.0@0.1.0 deploy: `inhyechoi -d build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the v1.0.0@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
您在 package.json 中的deploy
命令是"deploy": "inhyechoi -d build -b master"
错误是说inhyechoi
不是命令,这是正确的,只是您的项目名称,而不是可以在终端中调用的程序。
要构建npm run build
应用程序,请运行npm run build
或npm run-script build
。 要使用 netlify 进行部署,我相信您只需运行netlify
deploy”,因此请尝试将 package.json 的deploy
命令更改为"deploy" : "netlify deploy"
如果要构建和部署,可能需要将其更改为"deploy": "npm run build; netlify deploy"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.