Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LamaDabbeet85 opened this issue Oct 2, 2019 · 7 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.

Comments

@LamaDabbeet85
Copy link

LamaDabbeet85 commented Oct 2, 2019

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,

@LamaDabbeet85 LamaDabbeet85 added the Type: Question Issues that are actually questions and not bug reports. label Oct 2, 2019
@react-native-bot
Copy link
Collaborator

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.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: No Template labels Oct 2, 2019
@lucas123ho
Copy link

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

@danm
Copy link

danm commented Feb 17, 2020

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?

@danm
Copy link

danm commented Feb 17, 2020

solution... update to react-scripts v3.4.0
more info here:
facebook/create-react-app#8490

@ganganiSoN
Copy link

@danm Thanks. It saves my hours.

@jonathantroncoso82
Copy link

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

@jheckbert
Copy link

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.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.
Projects
None yet
Development

No branches or pull requests

7 participants