首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用npm-start为React应用程序启动开发服务器时出错

使用npm-start为React应用程序启动开发服务器时出错
EN

Stack Overflow用户
提问于 2019-06-05 14:34:42
回答 1查看 444关注 0票数 1

我用npx create- react -app myapp创建了一个react应用程序。npm start不会启动开发人员服务器。我已经尝试重新安装node_modules,但它不起作用。我使用最新版本的React和Node Package Manager。

错误:

代码语言:javascript
复制
     Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
     - configuration.module.rules[2].oneOf[1].include should be one of these:
       RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? } | [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
       -> One or multiple rule conditions
       Details:
        * configuration.module.rules[1].include should be an instance of RegExp
        * configuration.module.rules[1].include: The provided value "E:\\!!Netbeans\\!React js tutorial\\my-app\\src" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.
        * configuration.module.rules[1].include should be an instance of function
        * configuration.module.rules[1].include should be an array:
          [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
        * configuration.module.rules[1].include should be an object.
        * configuration.module.rules[1].include should be an array:
  [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
        * configuration.module.rules[2].oneOf[1].include should be an instance of RegExp
        * configuration.module.rules[2].oneOf[1].include: The provided value "E:\\!!Netbeans\\!React js tutorial\\my-app\\src" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.
        * configuration.module.rules[2].oneOf[1].include should be an instance of function
        * configuration.module.rules[2].oneOf[1].include should be an array:
  [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]
        * configuration.module.rules[2].oneOf[1].include should be an object.
        * configuration.module.rules[2].oneOf[1].include should be an array:
          [RegExp | string | function | [(recursive)] | object { and?, exclude?, include?, not?, or?, test? }]

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! my-app@0.1.0 start: `react-scripts start`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the my-app@0.1.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely                 additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Сергей\AppData\Roaming\npm-cache\_logs\2019-06-04T14_34_52_240Z-debug.log

我试着重新安装node_modules,但它不工作。请帮帮我!

Package.json文件:

代码语言:javascript
复制
    {
      "name": "myapp",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-scripts": "3.0.1"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      },
      "eslintConfig": {
        "extends": "react-app"
      },
      "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
        "development": [
          "last 1 chrome version",
          "last 1 firefox version",
          "last 1 safari version"
        ]
      }
    }
EN

回答 1

Stack Overflow用户

发布于 2020-12-16 16:57:58

我也遇到过同样的问题,但是删除目录(文件夹)中的感叹号对我很有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56455306

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档