当前位置: 首页 > 知识库问答 >
问题:

未能浏览部署到Heroku的React应用程序

邵弘伟
2023-03-14

当wirite https://tictactoesko.herokuapp.com/在浏览器中时,我重新输入Follow错误消息:

{
  "name": "tic-tac-toe",
  "version": "0.1.0",
  "private": true,
  "eslintConfig": {
    "env": {
      "es6": true
    },
    "parserOptions": {
      "ecmaVersion": 8,
      "sourceType": "module",
      "ecmaFeatures": {
        "jsx": true
      }
    },
    "extends": [
      "standard",
      "react-app",
      "plugin:jsx-a11y/recommended" 
    ],
    "plugins": [
      "jsx-a11y",
      "react"
      ],
    "rules": {
      "no-trailing-spaces": "off",
      "padded-blocks":"off",
      "jsx-a11y/href-no-hash":"off"
   }
  },
  "jest": {
    "testMatch": [
      "**/test/**/*.js?(x)"
    ],
    "collectCoverage": true,
    "coverageDirectory": "coverage",
    "coverageThreshold": {
      "global": {
        "branches": 100,
        "functions": 100,
        "lines": 100,
        "statements": 100
      }
    }
  },
  "dependencies": {
    "chromedriver": "^2.35.0",
    "jest-cli": "^22.3.0",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.1.1",
    "selenium-webdriver": "^4.0.0-alpha.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "lint": "./node_modules/.bin/eslint  src/** test/** ",
    "test": "jest",
    "eject": "react-scripts eject",
    "cypress:open": "cypress open"
  },
  "devDependencies": {
    "babel-eslint": "^7.2.3",
    "babel-jest": "^22.2.2",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "cypress": "^2.0.3",
    "enzyme": "^3.3.0",
    "enzyme-adapter-react-16": "^1.1.1",
    "eslint": "^4.18.1",
    "eslint-config-google": "^0.9.1",
    "eslint-config-react-app": "^2.1.0",
    "eslint-config-standard": "^11.0.0",
    "eslint-plugin-flowtype": "^2.46.1",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.6.0",
    "eslint-plugin-react": "^7.7.0",
    "eslint-plugin-standard": "^3.0.1",
    "jest": "^22.3.0",
    "react-test-renderer": "^16.2.0"
  }
}

以下是travis.yml语言:node_js node_js:-node addons:sonarcloud:before_script:-npm start----silent&script:-npm run lint-npm test-sonar-scanner-dsonar.projectkey=tictactoe-dsonar.organization=steinko-github-dsonar.sources=src,test-dsonar.host.url=https://sonarcloud.io v.info-$(npm bin)/cypress run--record--key a1319fd9-2c6e-4888-8f02-e62f02b5001b ISD/HZQMTDYQDJCMGCGOZK4LZJMBPE8TMCCu0TNUPXJNUDPUZKRVIAK3PE/T8/M1MDZAZ4+2MAIXUJZSF//JJIMDWIE3ZQSOXQJEO9L4QMXCDSTRC3IAX+GLGJT2J9RF0ERNUKYPDFXXPUW8O4/TJHEYF32E+MUPNXX1PVEYZKP6NTBSS/288W0NPG42RXILEVNEJXWS8FGGUYQX52DHXCBZEZPOSYE233WTIQD6Q2PHPTOBQK7XJUYM7XS3QH8YAO/JB2ZYZ9PNZZNGSFC3COHGXFJ3YJWVMFY87Y/BB5JBVAXArmwg6zvkkt+lhdsvbr3cchn01s9wg4ygdiaviaia5veouci7ocgrdylyjtkau4enj/dahpxg+l7+wbrx292kl/9zgg0finabybog+ysjn/omqophnmqzr/gupf/n1t6uzvogh+zgzy7xtsri3efl4ggichfxonulvnrmjor04sk0cyznuwifmljgiuxgcuei9mubsoainws7krk6i9uw=app:tictactoes

部署日志feom Heroku看起来像这样构建依赖项:在11.521s中安装节点模块(package.json+package-lock)---->Caching build清除以前的节点缓存保存2个cacheDirectories(默认值):-node_modules-bower_components(nothing to cache)---->build successed!---->发现进程类型Procfile声明类型->(无)buildpack的默认类型->web----->压缩...完成:57.4米---->发射...发布v11 https://tictactoesko.herokuapp.com/部署到Heroku

当wirite https://tictactoesko.herokuapp.com/在浏览器中时,我重新输入Follow错误消息:

编译失败。/src/index.js模块构建失败:错误:找不到模块'eslint/lib/formatters/stylish'如何更正此错误?

共有1个答案

冯嘉珍
2023-03-14

您手动安装了eslint,这可能会损坏一些东西。您应该卸载它并只编辑.eslintrc文件。请看本期Github中@Gaearon的评论

但是如果您希望直接控制并自定义所有内容。我将弹出项目:npm run eject。查看Create React应用程序的指南。

 类似资料:
  • [错误]无法执行目标组织。阿帕奇。专家插件:maven编译器插件:3.8。1:在project Divi up后端上编译(默认编译):编译时出现致命错误:目标版本无效:15- 我得到了上面的错误,有人知道为什么会这样吗?

  • 问题内容: 我正在尝试在Heroku上使用Flask开发我的第一个“大型”应用程序,并尝试将此处的基本教程与以下说明结合:https : //devcenter.heroku.com/articles/python与以下说明:http:// flask.pocoo.org/docs/patterns/packages/#larger- applications。它在本地与“先行启动”一起工作,但是

  • 我试图将Spring Boot应用程序部署到Heroku,但我无法做到这一点。我的应用程序会自动检测为"heroku-maven-plugin",但我想将其部署为Java应用程序。 我怎样才能做到这一点?

  • 我正在Heroku上部署一个网站,但我在尝试运行“Heroku open”时收到了“应用程序错误”。 我相信我已经成功地将文件推送到Heroku中,这是我的“git推送heroku master”代码的一部分: 当我运行“heroku config-s | grep PATH”时,我得到了 我正在使用Ruby 1.9.3和Rails 4.0.0 文件夹 宝石环境 箱/轨道 垃圾箱/包裹 仓/耙

  • 我正试图将我的spring应用程序部署到heroku,但我相信maven插件中存在一些错误。尝试了所有可能的版本组合,在本地工作,但在部署时不工作。 当我跑步的时候: git push heroku master 以下是错误: 4.0.0 org.springframework.Boot Spring-Boot-starter-parent 2.3.3.发布com.project techupda