Skip to content
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

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

Closed
camillo777 opened this issue Mar 26, 2017 · 13 comments
Closed

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

camillo777 opened this issue Mar 26, 2017 · 13 comments

Comments

@camillo777
Copy link

camillo777 commented Mar 26, 2017

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/[email protected] (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/[email protected] (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/[email protected] (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/[email protected] (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/[email protected] (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/[email protected] (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 [email protected]: 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:
    [email protected] /Users/camillo/MyCamillo/Development/node/cdp2
    └── (empty)

  • npm ls react-native:
    [email protected] /Users/camillo/MyCamillo/Development/node/cdp2
    └── (empty)

  • npm ls expo:
    [email protected] /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.

@anp
Copy link
Contributor

anp commented Mar 27, 2017

Hi! Thanks for the report! I don't think this 'invalid name' error is specific to CRNA, but I may be wrong. Can you take a look at these previous issues and see if any of their resolutions are related to your issue?

npm/npm#6860 (comment)
npm/npm#13986

@camillo777
Copy link
Author

camillo777 commented Mar 27, 2017

Hi!
I tried with:
npm cache clear
npm install npm@latest

But still have problems:

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

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

npm WARN deprecated [email protected]: Use uuid module instead
npm ERR! unpack Could not read data for @ccheever/[email protected]
npm ERR! unpack Could not read data for @segment/[email protected]
npm ERR! unpack Could not read data for @exponent/[email protected]
npm ERR! unpack Could not read data for @exponent/[email protected]
npm ERR! unpack Could not read data for @exponent/[email protected]
npm ERR! unpack Could not read data for @exponent/[email protected]
npm ERR! unpack Could not read data for @exponent/[email protected]
[email protected] /Users/camillo/MyCamillo/Development/node/cdp
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]  extraneous
└── [email protected]  extraneous

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @segment/[email protected] (node_modules/@segment/loosely-validate-event):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@segment/loosely-validate-event"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @exponent/[email protected] (node_modules/@exponent/json-file):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/json-file"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @exponent/[email protected] (node_modules/@exponent/ngrok):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/ngrok"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @exponent/[email protected] (node_modules/@exponent/node-auth0):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/node-auth0"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @exponent/[email protected] (node_modules/@exponent/spawn-async):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/spawn-async"
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @exponent/[email protected] (node_modules/@exponent/osascript):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid name: "@exponent/osascript"
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/cdp/npm-debug.log
`npm install --save-dev --save-exact react-native-scripts` failed

Any more hints?
Thank you!
Camillo

@anp
Copy link
Contributor

anp commented Mar 27, 2017

Have you made sure that you have the correct permissions to your npm cache as suggested in the first link?

@camillo777
Copy link
Author

Hi!
It did not help unfortunately and it seems it was already like that:

[portion before]
70625119  0 drwxr-xr-x    3 camillo  staff    102 Mar 27 22:23 yesno
Camillos-MacBook-Pro:node_modules camillo$ chown -R camillo ~/.npm
[portion after]
Camillos-MacBook-Pro:node_modules camillo$ ls -lisa ~/.npm | grep yesno
70625119  0 drwxr-xr-x    3 camillo  staff    102 Mar 27 22:23 yesno

RESULT:

Camillos-MacBook-Pro:node camillo$ create-react-native-app cdp2
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 [email protected]: 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: "@exponent/json-file"
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

@anp
Copy link
Contributor

anp commented Mar 28, 2017

Do you have an npm mirror or local registry that you use? Anything which would cause name resolution to be different in your environment than others?

Can you try installing yarn and/or creating the project in a different directory? I have no idea why npm would be saying this package name is invalid -- scoped packages are pretty commonplace on npm these days.

@EranSch
Copy link

EranSch commented Mar 30, 2017

Pretty weird... I seem to be having a similar issue with creating a new app. Here's my current environment setup:

OSX 10.11.4 (El Capitan)

$ node -v
v6.10.1
$ npm -v
3.10.10
$ yarn --version
0.21.3

I've got CRNA install globally via yarn. When I try to create a new app, I get an authentication error on the same scoped packages noted in this issue...

$ create-react-native-app RedditViewer
Creating a new React Native app in /Users/eran/Repositories/RedditViewer.

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

yarn add v0.21.3
info No lockfile found.
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@exponent%2fjson-file: Could not authenticate eransch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/eran/Repositories/RedditViewer/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
`yarnpkg add --dev --exact --ignore-optional react-native-scripts` failed

If I try multiple times, it will sometimes fail on a different package but that may just come down to parallel fetching and which one fails first.

FWIW, my issue seems to be agnostic of CRNA, I simply can't install scoped pages with yarn for some reason...

yarn add @ccheever/crayon
yarn add v0.21.3
info No lockfile found.
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@ccheever%2fcrayon: Could not authenticate eransch".
info If you think this is a bug, please open a bug report with the information provided in "/Users/eran/Repositories/npmtest/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@anp
Copy link
Contributor

anp commented Mar 30, 2017

@Swingline0 from looking at:

yarnpkg/yarn#1260
yarnpkg/yarn#2151
yarnpkg/yarn#2515

There appear to be a number of issues with yarn and public scoped packages, especially when using a private npm proxy or registry. Can you attempt to rule those problems out?

@EranSch
Copy link

EranSch commented Mar 30, 2017

Thanks @dikaiosune, I'll check these out when I get home... naturally everything works fine on my work machine.

Off the bat #2515 sounds promising. With that said, I feel pretty comfortable in ruling my issue as not being specific to CRNA. Just something that I only first encountered when using CRNA.

@EranSch
Copy link

EranSch commented 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 :)

@anp
Copy link
Contributor

anp commented Mar 31, 2017

@Swingline0 glad to hear it.

@camillo777 are you able to install any public scoped packages? For example, if you init a blank npm project and run npm install --save @dengorbachev/foo? I'm wondering if this causes a failure on your machine. For example, here's what happens on mine:

0 adam@iceblade ~
$ mkdir testingscoped

0 adam@iceblade ~
$ cd testingscoped/

0 adam@iceblade ~/testingscoped
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (testingscoped)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/adam/testingscoped/package.json:

{
  "name": "testingscoped",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this ok? (yes)

0 adam@iceblade ~/testingscoped
$ npm i --save @dengorbachev/foo
[email protected] /Users/adam/testingscoped
└── @dengorbachev/[email protected]

npm WARN [email protected] No description
npm WARN [email protected] No repository field.

0 adam@iceblade ~/testingscoped
$ cat package.json
{
  "name": "testingscoped",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@dengorbachev/foo": "^1.0.0"
  }
}

@camillo777
Copy link
Author

camillo777 commented Apr 1, 2017 via email

@camillo777
Copy link
Author

I decided to uninstall Node and reinstall from scratch using the NodeJS installer on NodeJS site.
It seems it fixed it.
I have a problem with the Expo app (Android) QR code scanning which is doing nothing, but I dont think it is related to "create-react-native-app" script.
Thank you
Camillo

@anp
Copy link
Contributor

anp commented Apr 3, 2017

Glad to hear that the reinstall worked for you!

@anp anp closed this as completed Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants