I am trying to run a react application in my local machine , I get this error when I ran
npm run start
:
> node scripts/start.js
internal/validators.js:125
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
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.resolve (path.js:161:7)
at resolveApp (D:\Projects\react-app\react-site-master\config\paths.js:10:41)
at Object.<anonymous> (D:\Projects\react-app\react-site-master\config\paths.js:73:13)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node scripts/start.js`
npm ERR! Exit status 1
I have tried to do the following but it is the same:
Thanks in advance,
Make sure you have the correct version of react-scripts. Try react-scripts 3.4.0.
If you have a previous version of react-scripts, you can follow the directions on how to migrate from your version to 3.4.0: https://github.com/facebook/create-react-app/releases
Another option is to update your package.json file to use "react-scripts": "3.4.0"
. Make sure you delete your node_modules folder and package-lock.json before running npm install
after updating the package.json
Changing my version of react-scripts from 3.3.1 to 3.4.0 worked for me. Use the command
npm install --save --save-exact [email protected]
If you have [email protected] already you can upgrade it to v3.4.1 with the same command. This automatically updates the version listed on your package.json file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With