ionic-framework - 运行命令 ionic(5)serve 后出现以下错误

标签 ionic-framework

类型错误 [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。收到的类型未定义 在 validateString (内部/validators.js:112:11) 在 Object.join (path.js:375:7) 在noopServiceWorkerMiddleware (D:\React+ReactNative学习\myApp\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26) 在Layer.handle [作为handle_request] (D:\学习React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5) 在trim_prefix(D:\学习React+ReactNative\myApp\node_modules\express\lib\router\index.js:317:13) 位于D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:284:7 在Function.process_params (D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:335:12) 接下来(D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:275:10) 在启动EditorMiddleware时(D:\React+ReactNative学习\myApp\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7) 在Layer.handle [作为handle_request] (D:\学习React+ReactNative\myApp\node_modules\express\lib\router\layer.js:95:5) 在trim_prefix(D:\学习React+ReactNative\myApp\node_modules\express\lib\router\index.js:317:13) 位于D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:284:7 在Function.process_params (D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:335:12) 接下来(D:\React+ReactNative学习\myApp\node_modules\express\lib\router\index.js:275:10) 在handleWebpackInternalMiddleware (D:\学习React+ReactNative\myApp\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7) at Layer.handle [as handle_request] (D:\React+ReactNative学习\myApp\node_modules\express\lib\router\layer.js:95:5)

最佳答案

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

"react-scripts":"3.3.0" 

"react-scripts":"^3.4.0"

然后运行npm iionicserve,它就可以工作了。

更多信息请点击 https://github.com/facebook/create-react-app/issues/8490

关于ionic-framework - 运行命令 ionic(5)serve 后出现以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60236986/

相关文章:

angular - 错误错误 : InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

cordova - Ionic 安装时没有错误,但执行时不执行任何操作

javascript - Angular UI 路由器重定向到默认页面

javascript - 如何在angularjs中的选择选项中使用多选将json数据显示为optgroup

android - java.lang.SecurityException : GoogleCertificatesRslt: Package signed with debug key (go/gsrlt)

javascript - ionic /如何从选择控件中选择多个选项(最多选择 3 个选项)?

ionic-framework - 是否可以设置 ionic 模态的绝对位置?

Android 构建失败 'failed to run ant version'

javascript - 如何在模糊时触发 ng-messages?

javascript - 如何在 Ionic 中的选项卡之间传递数据