首页 / REACT / nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str
nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1985字,纯文字阅读大概需要3分钟。
内容图文
![nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str](/upload/InfoBanner/zyjiaocheng/633/3b80b67791cf4853be70e9aa99881b0c.jpg)
首先react需要安装nodejs
然后安装react
https://www.runoob.com/react/react-install.html
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:117:11)
at Object.join (path.js:375:7)
at noopServiceWorkerMiddleware (D:\IDEA\work\xlore-util\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26)
at Layer.handle [as handle_request] (D:\IDEA\work\xlore-util\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:317:13)
at D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:284:7
at Function.process_params (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:335:12)
at next (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:275:10)
at launchEditorMiddleware (D:\IDEA\work\xlore-util\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7)
at Layer.handle [as handle_request] (D:\IDEA\work\xlore-util\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:317:13)
at D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:284:7
at Function.process_params (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:335:12)
at next (D:\IDEA\work\xlore-util\node_modules\express\lib\router\index.js:275:10)
at handleWebpackInternalMiddleware (D:\IDEA\work\xlore-util\node_modules\react-dev-utils\evalSourceMapMiddleware.js:42:7)
at Layer.handle [as handle_request] (D:\IDEA\work\xlore-util\node_modules\express\lib\router\layer.js:95:5)
一般是因为版本问题。
我这边的解决办法:
- 在package.json中,把"react-scripts": "^3.3.0" 替换为"react-scripts": "^3.4.0"
- 删除node_modules文件夹
- 执行npm install 或者 yarn install重新安装依赖包(在工程所在文件夹shift + 右键 - 在此处打开命令窗口,然后输入, 或者直接cmd然后cd到所在位置也行)
然后
yarn start
启动
内容总结
以上是互联网集市为您收集整理的nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str全部内容,希望文章能够帮你解决nodejs - react - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type str所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。