报错记录 | The "path" argument must be of type string.

报错内容

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

解决办法

参照:https://github.com/facebook/create-react-app/issues/8490
react-scripts升级到3.4.0版本即可解决

参照: https://github.com/facebook/create-react-app/releases
命令如下:
npm install --save --save-exact [email protected]yarn add --exact [email protected]

重新启动项目npm start

完事儿!

你可能感兴趣的:(报错摘记)