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
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
- fix: set project directory to install packages in init command (#262) Fixes https://github.com/react-native-community/react-native-cli/issues/260 and https://github.com/facebook/react-native/issues/2... — committed to react-native-community/cli by BasitAli 5 years ago
- fix: set project directory to install packages in init command (#262) Fixes https://github.com/react-native-community/react-native-cli/issues/260 and https://github.com/facebook/react-native/issues/2... — committed to react-native-community/cli by BasitAli 5 years ago
- Sync fork (#1) * chore: use @react-native-community/eslint-config (#205) Summary: --------- I changed @callstack/eslint-config to @react-native-community/eslint-config and fixed all lint issue... — committed to dratwas/react-native-cli by dratwas 5 years ago
- fix: set project directory to install packages in init command (#262) Fixes https://github.com/react-native-community/react-native-cli/issues/260 and https://github.com/facebook/react-native/issues/2... — committed to dratwas/react-native-cli by BasitAli 5 years ago
It works with previous versions:
this is how my package.json looked after the react-native init command:
Have same issue: node v11.12.0 npm 6.7.0
i have met this problem too,looked up the stack trace it seems that PackageManager.projectDir is not set 😢
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 worked with the old version