简体   繁体   English

我无法使用 npm run deploy 部署 react 应用程序

[英]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 buildnpm 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.

相关问题 npm run deploy 不起作用,无法将反应应用程序部署到 github - npm run deploy is not working, can't deploy react app to github 我无法在 Heruko 上部署此应用程序,但我可以在本地运行它 - I can't deploy this app on Heruko but I can run it locally 无法在 Laravel 项目中使用 deploy.sh 文件运行“npm run prod”(使用 Laravel Mix) - Can't run "npm run prod" using a deploy.sh file in a Laravel project (using Laravel Mix) 我无法在 github 上部署 react - I can't deploy react on github 如何在 Heroku 上部署 nextjs 和 nodejs 而不使用 npm 在客户端/前端运行构建? - How can I deploy nextjs and nodejs on Heroku without using npm run build on the client/frontend side? 我无法将Angular应用部署到heroku - I can't deploy an Angular app to heroku Serverless 是否总是在部署时运行“npm i”? - Have Serverless always run `npm i` at deploy? 无法将简单的节点 js 反应应用程序部署到弹性 Beanstalk - Can't deploy simple node js react app to elastic Beanstalk Firebase 部署 | 您需要启用 JavaScript 才能运行此应用程序。 | “npm start”有效,但“firebase serve”无效 - Firebase Deploy | You need to enable JavaScript to run this app. | 'npm start' works but 'firebase serve' doesn't 尝试部署 web 应用程序时,前端使用 create-react-app 而不是 npm 在 VPS 上正确安装 - Frontend using create-react-app not npm installing correctly on VPS when trying to deploy web app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM