ionic-framework - 运行命令 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:
解决方案
我找到了一个修复,似乎问题源于 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
推荐阅读
- java - 数组查找扫描器整数的索引
- python - 用来自另一个数据框的值填充多列
- dart - 是否可以在 Flutter Web 中为域添加前缀?
- python - 如何根据 Django 中的模型实例数填充 CreateView 字段
- python - 在 pandas 中应用函数的替代方法
- firebase - Flutter:在框架模块“firebase_core.FLTFirebasePlugin”中包含非模块化标头
- html - 按钮和视频在 HTML/Bootstrap 部分中不起作用
- binary-data - 量子计算与传统 base10 系统
- svelte - Svelte 有没有办法以非阻塞方式加载 {#each} 元素?
- android - 画中画 打开应用程序的新窗口并显示大量最近的任务