question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error creating new app with "create-react-native-app"

See original GitHub issue

Please make our job easier by filling this template out to completion. If you’re requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

Trying to create my first react native app with the “create-react-native-app” script.

Expected Behavior

Just started the command as per the “Getting started” guide. create-react-native-app cdp2

Observed Behavior

Warning and errors and failed at the end. Tried with and without “sudo”: same result.

If there’s an error message, please paste the full terminal output and error message in this code block:

First time this was the error:

[...]
45828 silly gunzTarPerm extractEntry modules/library/web.dom.iterable.js
45829 silly gunzTarPerm extractEntry modules/library/es6.function.name.js
45830 silly gunzTarPerm extractEntry CHANGELOG.md
45831 silly gunzTarPerm extractEntry stage/0.js
45832 silly gunzTarPerm extractEntry stage/1.js
45833 silly gunzTarPerm extractEntry stage/2.js
45834 silly gunzTarPerm extractEntry stage/3.js
45835 silly gunzTarPerm extractEntry stage/4.js
45836 silly gunzTarPerm extractEntry stage/index.js
45837 silly gunzTarPerm extractEntry stage/pre.js
45838 silly gunzTarPerm extractEntry web/dom-collections.js
45839 silly gunzTarPerm extractEntry web/immediate.js
45840 silly gunzTarPerm extractEntry web/index.js
45841 silly gunzTarPerm extractEntry web/timers.js
45842 silly gentlyRm /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/lodash-es-b916ed5a/node_modules is being purged
45843 verbose gentlyRm don't care about contents; nuking /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/lodash-es-b916ed5a/node_modules
45844 silly gentlyRm /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-4ffe8fec/node_modules is being purged
45845 verbose gentlyRm don't care about contents; nuking /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-4ffe8fec/node_modules
45846 silly gentlyRm /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-abba61bc/node_modules is being purged
45847 verbose gentlyRm don't care about contents; nuking /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-abba61bc/node_modules
45848 silly gentlyRm /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/lodash-12006e48/node_modules is being purged
45849 verbose gentlyRm don't care about contents; nuking /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/lodash-12006e48/node_modules
45850 silly gentlyRm /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-548f74d9/node_modules is being purged
45851 verbose gentlyRm don't care about contents; nuking /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging/core-js-548f74d9/node_modules
45852 verbose unlock done using /Users/camillo/.npm/_locks/staging-9dfb31c6f417c59c.lock for /Users/camillo/MyCamillo/Development/node/cdp/node_modules/.staging
45853 silly rollbackFailedOptional Starting
45854 silly rollbackFailedOptional Finishing
45855 silly runTopLevelLifecycles Finishing
45856 silly install printInstalled
45857 warn optional SKIPPING OPTIONAL DEPENDENCY: @segment/loosely-validate-event@1.1.2 (node_modules/@segment/loosely-validate-event):
45858 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@segment/loosely-validate-event"
45859 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45859 verbose optional If you need help, you may report this error at:
45859 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45860 warn optional SKIPPING OPTIONAL DEPENDENCY: @exponent/json-file@5.3.0 (node_modules/@exponent/json-file):
45861 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/json-file"
45862 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45862 verbose optional If you need help, you may report this error at:
45862 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45863 warn optional SKIPPING OPTIONAL DEPENDENCY: @exponent/ngrok@2.2.7 (node_modules/@exponent/ngrok):
45864 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/ngrok"
45865 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45865 verbose optional If you need help, you may report this error at:
45865 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45866 warn optional SKIPPING OPTIONAL DEPENDENCY: @exponent/node-auth0@2.6.0 (node_modules/@exponent/node-auth0):
45867 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/node-auth0"
45868 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45868 verbose optional If you need help, you may report this error at:
45868 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45869 warn optional SKIPPING OPTIONAL DEPENDENCY: @exponent/spawn-async@1.2.8 (node_modules/@exponent/spawn-async):
45870 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/spawn-async"
45871 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45871 verbose optional If you need help, you may report this error at:
45871 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45872 warn optional SKIPPING OPTIONAL DEPENDENCY: @exponent/osascript@1.6.4 (node_modules/@exponent/osascript):
45873 warn optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/osascript"
45874 verbose optional SKIPPING OPTIONAL DEPENDENCY:
45874 verbose optional If you need help, you may report this error at:
45874 verbose optional SKIPPING OPTIONAL DEPENDENCY:     <https://github.com/npm/npm/issues>
45875 verbose stack Error: Invalid name: "@ccheever/crayon"
45875 verbose stack     at ensureValidName (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:284:15)
45875 verbose stack     at Object.fixNameField (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js:199:5)
45875 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:29:38
45875 verbose stack     at Array.forEach (native)
45875 verbose stack     at normalize (/usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js:28:15)
45875 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:349:5)
45875 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:124:5)
45875 verbose stack     at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:189:20)
45875 verbose stack     at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
45875 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:357:13)
45876 verbose cwd /Users/camillo/MyCamillo/Development/node/cdp
45877 error Darwin 14.5.0
45878 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save-dev" "--save-exact" "react-native-scripts"
45879 error node v7.6.0
45880 error npm  v4.1.2
45881 error Invalid name: "@ccheever/crayon"
45882 error If you need help, you may report this error at:
45882 error     <https://github.com/npm/npm/issues>
45883 verbose exit [ 1, true ]

Then trying a second time:

Camillos-MacBook-Pro:node camillo$ sudo create-react-native-app cdp2
Password:
Creating a new React Native app in /Users/camillo/MyCamillo/Development/node/cdp2.

Installing packages. This might take a couple minutes.
Installing react-native-scripts...

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save-dev" "--save-exact" "react-native-scripts"
npm ERR! node v7.6.0
npm ERR! npm  v4.1.2

npm ERR! Invalid name: "@ccheever/crayon"
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/camillo/MyCamillo/Development/node/cdp2/npm-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: cdp2@0.1.0 /Users/camillo/MyCamillo/Development/node/cdp2 └── (empty)

  • npm ls react-native: cdp2@0.1.0 /Users/camillo/MyCamillo/Development/node/cdp2 └── (empty)

  • npm ls expo: cdp2@0.1.0 /Users/camillo/MyCamillo/Development/node/cdp2 └── (empty)

  • node -v: v7.6.0

  • npm -v: 4.1.2

  • yarn --version: -bash: yarn: command not found

  • watchman version: -bash: watchman: command not found

Also specify:

  1. Operating system: OSX 10.10.5 (14F2109)
  2. Phone/emulator/simulator & version:

Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you’re reporting.

Issues that come with minimal repro’s are resolved much more quickly than issues where a maintainer has to reproduce themselves.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
anpcommented, Apr 3, 2017

Glad to hear that the reinstall worked for you!

3reactions
EranSchcommented, Mar 31, 2017

Following the thoughts put forth in yarnpkg/yarn#2515, I commented out the _auth and email lines in my ~/.npmrc file and re-ran CRNA. Everything worked as expected this time, no problems.

Looks like, in my case, this was an issue with Yarn. Perhaps @camillo777’s issue might be related in some way although it doesn’t look like it off the bad. Good luck!

Thanks @dikaiosune 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error creating new app with "create-react-native-app" #229
Description I tried to create a new react native app using the command "create-react-native-app" I'm using window 8.
Read more >
I want to create React Native App, but getting this error. What ...
1 Answer 1 · Download and install JDK (v7 or newer) · Download and install Node · Download and install Android Studio Create...
Read more >
Create a New React App
If you're learning React or creating a new single-page app, use Create React App. If you're building a server-rendered website with Node.js, try...
Read more >
Troubleshooting - React Native
These are some common issues you may run into while setting up React Native. If you encounter something that is not listed here, ......
Read more >
Addressing common errors in React Native - LogRocket Blog
After creating a new React Native project, when attempting to run the app for the first time with the command react-native run-android ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found