美文网首页
react 打包项目npm start 报错 Failed at

react 打包项目npm start 报错 Failed at

作者: 牛奶大泡芙 | 来源:发表于2021-05-12 11:59 被阅读0次

    用webpack打包的时候,出现了报错,情况如下:


    image.png

    package.json文件是这样配置命令的:

    "scripts": {
        "start": "npm-run-all --parallel dev:*",
        "dev:server-compile": "webpack --config webpack.config.server.js --watch",
        "dev:server": "nodemon ./build/server.js",
        "dev:client-compile": "webpack --config webpack.config.client.js --watch"
      }
    

    可能是因为我的webpack,webpack-cli,webpack-dev-server版本不匹配导致的。
    我用的版本:

        "webpack": "^5.10.0",
        "webpack-cli": "^3.3.12",
        "webpack-dev-server": "^3.11.2",
    

    建议的版本:

        "webpack": "^4.44.1",
        "webpack-cli": "^3.3.12",
        "webpack-dev-server": "^3.11.0"
    

    相关文章

      网友评论

          本文标题:react 打包项目npm start 报错 Failed at

          本文链接:https://www.haomeiwen.com/subject/rihadltx.html