纱线升级后出现TypeERROR(ReactJS项目)

时间:2020-02-15 22:29:03

标签: javascript reactjs npm typeerror yarnpkg

我运行了纱线升级命令,然后下次启动纱线时出现此错误,我不知道为什么?希望有人可以告诉我这是怎么回事?不知道该怎么办才能解决它。尝试谷歌搜索,没有什么太大的运气。

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)

2 个答案:

答案 0 :(得分:1)

尝试运行yarn cache list以打印出缓存的软件包,然后可以与package.json中的版本进行比较以确保它们匹配。 如果仍然出现错误,请运行yarn cache clean清除整个缓存,然后运行yarn install重新填充它们。

答案 1 :(得分:0)

尝试删除节点模块,然后重新安装新版本