简体   繁体   English

纱线升级后出现类型错误(ReactJS 项目)

[英]TypeERROR after yarn upgrade (ReactJS project)

I ran the command yarn upgrade and then I got this error next time I did yarn start, and I have no idea why?我运行了命令 yarn upgrade ,然后在下次执行 yarn start 时出现此错误,我不知道为什么? Hoping someone can tell me whats going on here?希望有人能告诉我这里发生了什么? No idea what to do to solve it.不知道该怎么做才能解决它。 Tried googling it, without much luck as to what is wrong.尝试使用谷歌搜索它,但没有多少运气出了什么问题。

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

Try running yarn cache list to print out your cached packages, then you can compare with the version in your package.json to make sure they match.尝试运行yarn cache list打印出缓存的包,然后您可以与package.json的版本进行比较以确保它们匹配。 If you still get errors, run yarn cache clean to clear your entire cache and run yarn install to repopulate them.如果仍然出现错误,请运行yarn cache clean清除整个缓存并运行yarn install重新填充它们。

尝试删除节点模块并使用新版本重新安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM