Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 无法将create react应用程序部署到github页面_Reactjs_Github_Deployment_Github Pages - Fatal编程技术网

Reactjs 无法将create react应用程序部署到github页面

Reactjs 无法将create react应用程序部署到github页面,reactjs,github,deployment,github-pages,Reactjs,Github,Deployment,Github Pages,我正在尝试使用gh pages部署react应用程序,生成成功,但在部署时出现以下错误: > reactapp@0.1.0 deploy C:\Users\javier\Desktop\Code\React1.0\1.1\CV19\reactapp > gh-pages -d build warning: failed to remove node_modules/jest-environment-jsdom-fourteen/node_modules/jsdom/lib/jsdo

我正在尝试使用gh pages部署react应用程序,生成成功,但在部署时出现以下错误:

> reactapp@0.1.0 deploy C:\Users\javier\Desktop\Code\React1.0\1.1\CV19\reactapp
> gh-pages -d build

warning: failed to remove node_modules/jest-environment-jsdom-fourteen/node_modules/jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js: Filename too long

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR!reactapp@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reactapp@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
My package.json:

  {
  "homepage ": "http://javier.github.io/reactapp",
  "name": "reactapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.11.0",
    "@material-ui/icons": "^4.9.1",
    "@reduxjs/toolkit": "^1.4.0",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "axios": "^0.21.0",
    "gh-pages": "^2.0.1",
    "mapbox-gl": "^1.12.0",
    "react": "^16.13.1",
    "react-bootstrap-icons": "^1.0.0",
    "react-dom": "^16.13.1",
    "react-map-gl": "^5.2.8",
    "react-mapbox-gl": "^5.0.0",
    "react-redux": "^7.2.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "^4.0.0",
    "redux": "^4.0.5"
  },
  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

有人知道是什么导致了这个错误吗?

这是由Windows本身造成的

在Windows文件命名系统下,总名称或路径不能超过259个字符。这包括文件夹路径、文件名和文件扩展名。如果是,那么当您尝试删除或移动它时,您将收到此错误

我已通过重命名受影响的文件夹或文件修复了此问题。在您的情况下,该文件位于node_modules文件夹中,这使它更难处理

我建议将应用程序移动到顶级文件夹,而不是桌面上的嵌套文件夹中


编辑:在Microsoft的帮助论坛上有可能会有所帮助。

这是由Windows本身造成的

在Windows文件命名系统下,总名称或路径不能超过259个字符。这包括文件夹路径、文件名和文件扩展名。如果是,那么当您尝试删除或移动它时,您将收到此错误

我已通过重命名受影响的文件夹或文件修复了此问题。在您的情况下,该文件位于node_modules文件夹中,这使它更难处理

我建议将应用程序移动到顶级文件夹,而不是桌面上的嵌套文件夹中


编辑:在Microsoft的帮助论坛上有一个可能有用的文件。

问题是文件名太长。您可能应该将测试库移动到devdependency,因为它们在生产环境中并不需要,并尝试再次部署它。或者移动文件夹,使文件名不那么长。问题是文件名太长。您可能应该将测试库移动到devdependency,因为它们在生产环境中并不需要,并尝试再次部署它。或者移动文件夹,使文件名不会太长。