简体   繁体   English

尝试将我的反应应用程序部署到 github 后,“npm run deploy”无法正常工作

[英]"npm run deploy" not working after trying to deploy my react app to github

"npm run deploy" not working after trying to deploy my react app to github and getting: ENOENT: no such file or directory, stat 'C:s<path\build>' C:\Users\USER 2021\Desktop\robotfriends>npm run deploy npm WARN config global --global , --local are deprecated. “npm run deploy”在尝试将我的反应应用程序部署到 github 并得到:ENOENT:没有这样的文件或目录,stat 'C:s<path\build>' C:\Users\USER 2021\Desktop\robotfriends>npm run deploy npm WARN config global --global--local已弃用。 Use --location=global instead.请改用--location=global

robotfriends@0.1.0 predeploy npm run build robotsfriends@0.1.0 预部署 npm 运行构建

npm WARN config global --global , --local are deprecated. npm WARN config global --global--local已弃用。 Use --location=global instead.请改用--location=global

robotfriends@0.1.0 build react-scripts build robotsfriends@0.1.0 build react-scripts build

robotfriends@0.1.0 deploy gh-pages -d build robotsfriends@0.1.0 部署 gh-pages -d build

ENOENT: no such file or directory, stat 'C:\Users\USER 2021\Desktop\robotfriends\build' ENOENT:没有这样的文件或目录,stat 'C:\Users\USER 2021\Desktop\robotfriends\build'

here's my Package.json:这是我的 Package.json:

{
  "homepage": "https://Aligumi.github.io/robotfriends",
  "name": "robotfriends",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "tachyons": "^4.12.0",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "gh-pages": "^4.0.0"
  }
}

Found the solution my self: :) I had to run npm run build to create the build folder.我自己找到了解决方案::) 我必须运行npm run build来创建构建文件夹。 Then ran npm run deploy然后运行npm run 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 React Redux&#39;npm run deploy&#39;应用无法正常工作 - React Redux 'npm run deploy' app not working npm 运行部署对于反应应用程序无法正常工作 - npm run deploy not working properly for react app 我正在尝试在Github页面上部署我的Gatsby Blog,但是“ npm run deploy”返回错误 - I'm trying to deploy my Gatsby Blog on Github pages, but “npm run deploy” returns error 尝试 npm 运行迁移以部署我的应用程序时 heroku 出错 - Error on heroku when trying to npm run migrate to deploy my app 无法使用npm进行部署在github页面上的React中运行Deploy - Cannot deploy with npm run Deploy in React on github pages React - 我无法使用 npm 运行部署部署到 github - React - I can't deploy to github with npm run deploy 在我的反应应用程序上运行“npm run deploy”后提交对 git 的更改时出现问题 - Problems when it comes to committing changes to git after running 'npm run deploy' on my react app 无法在我的 React 应用程序中运行“npm run build”/“npm run deploy”命令 - Can not run 'npm run build' / 'npm run deploy' command in my react app 无法运行“npm run deploy”抛出错误; // 将 React 应用程序部署到 Github 时未处理的“错误”事件 - can't run "npm run deploy" throw er; //unhandled 'error' event while deploying the react app into Github
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM