[英]I can't deploy react app using npm run deploy
I need advice to debug deployment of React site from Github to Netlify.我需要建议来调试 React 站点从 Github 到 Netlify 的部署。
I use the code below for deployment: npm run deploy我使用下面的代码进行部署: npm run deploy
This is Error on terminal:这是终端上的错误:
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.
What I have tried so far:到目前为止我尝试过的:
-uninstall npm -reinstall npm with latest update -remove node modules -install node modules -npm cache clear -npm ci -uninstall npm -reinstall npm with latest update -remove node modules -install node modules -npm cache clear -npm ci
This is the github repo: https://github.com/inhyechoi/inhyechoi-portfolio/这是 github 存储库: https : //github.com/inhyechoi/inhyechoi-portfolio/
Complete log:完整日志:
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.
Your deploy
command in your package.json is "deploy": "inhyechoi -d build -b master"
您在 package.json 中的
deploy
命令是"deploy": "inhyechoi -d build -b master"
The error is saying inhyechoi
is not a command, which is correct that is only the name of your project, not a program that can be called in terminal.错误是说
inhyechoi
不是命令,这是正确的,只是您的项目名称,而不是可以在终端中调用的程序。
To build a react app run npm run build
or npm run-script build
.要构建
npm run build
应用程序,请运行npm run build
或npm run-script build
。 To deploy with netlify I believe you just run netlify
deploy" so try changing your package.json's deploy
command to "deploy" : "netlify deploy"
要使用 netlify 进行部署,我相信您只需运行
netlify
deploy”,因此请尝试将 package.json 的deploy
命令更改为"deploy" : "netlify deploy"
If you want to build and deploy you may have to change it to "deploy": "npm run build; netlify deploy"
如果要构建和部署,可能需要将其更改为
"deploy": "npm run build; netlify deploy"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.