diff --git a/react-native-cli/index.js b/react-native-cli/index.js index 795e8143e..e2ae7586b 100755 --- a/react-native-cli/index.js +++ b/react-native-cli/index.js @@ -167,7 +167,7 @@ if (cli) { } function validateProjectName(name) { - if (!name.match(/^[$A-Z_][0-9A-Z_$]*$/i)) { + if (!String(name).match(/^[$A-Z_][0-9A-Z_$]*$/i)) { console.error( '"%s" is not a valid name for a project. Please use a valid identifier ' + 'name (alphanumeric).',