react-native: react native init throwing error ERR_INVALID_ARG_TYPE(name, 'string', value)

Hello, I am having some issue with react native init for creating a new project. The error is something like wqeqweasadad

just executing react-native init projectName project creation failed wth ` 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)

`

node v11.10.0 npm 6.7.0 yarn 1.13.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 22
  • Comments: 37 (2 by maintainers)

Commits related to this issue

Most upvoted comments

It works with previous versions:

react-native init --version "0.58.6"

this is how my package.json looked after the react-native init command:

{
  "name": "answers",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "react-native": "0.59.1"
  }
}

Have same issue: node v11.12.0 npm 6.7.0

info Adding required dependencies
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

i have met this problem too,looked up the stack trace it seems that PackageManager.projectDir is not set 😢

It works with previous versions:

react-native init --version "0.58.6"

worked pretty well

same problem here, just can’t start a new project

I’m too. Yesterday was working fine, but now give this error. I tried to put a package.json file and run “npm i”, but when i run the app, it doesn’t recognize the AVD

I really don’t understand. What’s wrong !!! Is that the react-native cli causing this problem. I am just hanged up don’t know and can’t find

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

same problem happens with node 10 and 11 here.

Looks like it’s probably related to @react-native-community/cli being updated 7 hours ago.

react-native-community/react-native-cli#260

If you’re looking for a quick solution can edit a file in node modules: react-native-community/react-native-cli@0c00895 and re-run the command. It worked for me.

reference: https://github.com/facebook/react-native/issues/24108#issuecomment-475822529

It works with previous versions:

react-native init --version "0.58.6"

it worked with the old version