React-native: React App - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined

Created on 2 Oct 2019  路  7Comments  路  Source: facebook/react-native

Hello,

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:
1- npm cache clean --force
2-delete node_modules with package-lock.json
3- npm install

Thanks in advance,

Ran Commands Question

Most helpful comment

solution... update to react-scripts v3.4.0
more info here:
https://github.com/facebook/create-react-app/issues/8490

All 7 comments


We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

馃憠 Click here if you want to report a reproducible bug or regression in React Native.

I solved this problem deleting the node_modules repository and install dependencies one by one.

In my case:
1) sudo rm -rf node_modules
2) yarn add axios react react-router-dom react-scripts styled-components

I'm using React-Dom but seeing this same issue. I've recently imported ReachRouter and Apollo.
Any ideas what is causing it or what it is isolated too?

solution... update to react-scripts v3.4.0
more info here:
https://github.com/facebook/create-react-app/issues/8490

@danm Thanks. It saves my hours.

thanks, solutions!!!
update to react-scripts v3.4.0
1- npm cache clean --force
2-delete node_modules with package-lock.json
3- npm install

Even after updating react-scripts to v3.4.1, I continued to receive the same error. In a last ditch attempt, I updated react-scripts to @latest and that seemed to fix it for me. Something to keep in mind when everything else seems to fail.

Was this page helpful?
0 / 5 - 0 ratings