首页 > 解决方案 > 运行命令 ionic(5) serve 后出现以下错误

问题描述

TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。在 noopServiceWorkerMiddleware (D:\Learning of React+ReactNative\myApp\node_modules\react-dev-utils 的 Object.join (path.js:375:7) 处收到未定义的类型\noopServiceWorkerMiddleware.js:14:26) 在 Layer.handle [as handle_request] (D:\Learning of React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5) at 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:

标签: ionic-framework

解决方案


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

"react-scripts":"3.3.0" 

"react-scripts":"^3.4.0"

然后运行npm i并且ionic serve它工作。

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


推荐阅读