TypeError: The "path" argument must be of type string. Received undefined
I have a project with ReactJs. When I run the project with command npm start
I got an exception TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined.
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)
I have no idea why this is happening, if anyone has experienced this I would be grateful.
-
S1
Sandeep Kumar Jan 19 2021
This issue occurs when
react-scripts
package error, You need only upgrade this package to resolve the issue.
To check the latest version using the commandnpm info react-scripts version
.- Replace in your
package.json
"react-scripts": "^3.x.x" with "react-scripts": "^3.4.1" (or the latest available version) - Delete your
node_modules
folder (this step is optional) - Run
npm install
oryarn install
- Replace in your
-
M0
Marry Christ Jan 19 2021
I have got the same problem and I solved it by upgrading the
react-scripts
package from "react-scripts": "3.x.x" to "react-scripts": "^3.4.1" (or the latest available version).- Delete
node_modules
folder - Delete
package-lock.json
file - Rewrite the
package.json
file from "react-scripts": "3.x.x" to "react-scripts": "^3.4.1" - Install node packages again
npm i
Now, start the project
npm start
- Delete
-
M-1
Manish Kumar Jan 19 2021
To solve, update
react-scripts
to the latest version.yarn add react-scripts@latest
OR if you use npm
npm install react-scripts@latest
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.