Ionic-framework: 错误:TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。 收到未定义

创建于 2020-02-16  ·  10评论  ·  资料来源: ionic-team/ionic-framework

错误报告

离子版本:


[x] 5.0.0

当前行为:
一旦我创建了一个新的 Ionic React 应用程序,就会得到以下信息:错误。

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:118:11)
    at Object.join (path.js:1039:7)
    at noopServiceWorkerMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:317:13)
    at /home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:335:12)
    at next (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:275:10)
    at launchEditorMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:317:13)
    at /home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:335:12)
    at next (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:275:10)
    at handleWebpackInternalMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)

预期行为:
能够创建一个新的 Ionic React 应用程序。

重现步骤:
创建一个新的 Ionic React 应用程序。

相关代码:
ionic start <appname> --type='react'

其他信息:

只是为了仔细检查,创建一个新的 Ubuntu VM 并安装 node.js ionic 并运行ionic start <appname> --type="react"并仍然遇到相同的错误。 如果我使用角度我没有问题。

离子信息:

Ionic:

   Ionic CLI       : 6.1.0 (/usr/local/share/.config/yarn/global/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 5.0.0

Capacitor:

   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v13.8.0 (/home/yunier/.nvm/versions/node/v13.8.0/bin/node)
   npm    : 6.13.6
   OS     : Linux 5.3
triage

最有用的评论

嗨,将react-scripts包从v3.3.0升级到v3.4.0解决了这个问题。

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

所有10条评论

嗨,将react-scripts包从v3.3.0升级到v3.4.0解决了这个问题。

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

谢谢你的问题。 我将关闭它,因为这是启动器依赖项的问题,而不是框架的问题。 我会考虑合并https://github.com/ionic-team/starters/pull/1137

谢谢! 现在工作。

谢谢。 我的项目再次运行。

弹出 react-scripts 时如何修复错误?

react-scripts被弹出时:

我将react-dev-utils降级为10.0.0并为我工作。

npm remove react-dev-utils && npm i [email protected]

https://www.gitmemory.com/issue/facebook/create-react-app/8499/588591098

删除并重新安装react-dev-utils为我解决了这个问题

降级react-dev-utils解决了我的问题....谢谢...

npm remove react-dev-utils && npm i [email protected]

降级 react-dev utils 解决了这个问题。

npm remove react-dev-utils && npm i [email protected]

谢谢你的问题! 此问题已被锁定,以防止与原始问题无关的评论。 如果这仍然是最新版本的 Ionic 的问题,请创建一个新问题并确保完整填写模板。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

alexbainbridge picture alexbainbridge  ·  3评论

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  ·  3评论

gio82 picture gio82  ·  3评论

SebastianGiro picture SebastianGiro  ·  3评论

manucorporat picture manucorporat  ·  3评论