我无法使用 npm 运行部署部署反应应用程序



我需要建议来调试React站点从Github到Netlify的部署。

我使用以下代码进行部署:npm运行部署

这是终端错误:

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.

到目前为止我尝试过的:

-卸载npm-使用最新更新重新安装npm-删除节点模块-安装节点模块-npm缓存清除-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不是一个命令,这是正确的,只是你项目的名称,而不是一个可以在终端中调用的程序。

要构建react应用程序,请运行npm run buildnpm run-script build。要使用netlify进行部署,我相信您只需运行netlifydeploy";因此,请尝试将您的包.json的deploy命令更改为"deploy" : "netlify deploy"

如果你想构建和部署,你可能必须将其更改为"deploy": "npm run build; netlify deploy"