【问题标题】:The below error occurred after running the command ionic(5) serve运行命令 ionic(5) serve 后出现以下错误
【发布时间】:2020-05-30 21:10:36
【问题描述】:

TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。接收类型未定义 在 validateString (internal/validators.js:112:11) 在 Object.join (path.js:375:7) 在 noopServiceWorkerMiddleware (D:\Learning of React+ReactNative\myApp\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26) 在 Layer.handle [as handle_request] (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5) 在 trim_prefix (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:317:13) 在 D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:284:7 在 Function.process_params (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:335:12) 在下一个(D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:275:10) 在 launchEditorMiddleware (D:\Learning of React+ReactNative\myApp\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7) 在 Layer.handle [as handle_request] (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5) 在 trim_prefix (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:317:13) 在 D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:284:7 在 Function.process_params (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:335:12) 在下一个(D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\index.js:275:10) 在 handleWebpackInternalMiddleware (D:\Learning of React+ReactNative\myApp\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7) 在 Layer.handle [as handle_request] (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5)

【问题讨论】:

    标签: ionic-framework


    【解决方案1】:

    我找到了一个修复,似乎问题源于 react-scripts 3.3.x 系列。在 package.json 我改变了

    "react-scripts":"3.3.0" 
    

    "react-scripts":"^3.4.0"
    

    然后运行npm iionic serve 就可以了。

    更多信息在这里https://github.com/facebook/create-react-app/issues/8490

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-03
      • 1970-01-01
      • 2021-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多