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

Fails to install on windows 10, whitespace in path issue? #4042

Closed
anderssonola opened this issue Feb 19, 2018 · 6 comments
Closed

Fails to install on windows 10, whitespace in path issue? #4042

anderssonola opened this issue Feb 19, 2018 · 6 comments

Comments

@anderssonola
Copy link

anderssonola commented Feb 19, 2018

Is this a bug report?

yes

Did you try recovering your dependencies?

npm 5.60

Which terms did you search for in User Guide?

npx

Environment

  1. node -v: 9.5.0
  2. npm -v: 5.6.0
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant):

Steps to Reproduce

  1. npx create-react-app my-app

Expected Behavior

The folder "my-app" is created and the create-react-app is installed in that folder

Actual Behavior

Failed to install create-react-app, looks like a problem with white-spaces in path, my user is "Ola Andersson" and the error message reports failure on "Andersson".

PowerShell log:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "Andersson\AppData\Roaming\npm-cache\_npx\12704" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ola Andersson\AppData\Roaming\npm-cache\_logs\2018-02-19T09_09_57_341Z-debug.log
Install for prefix@latest failed with code 1
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Andersson\AppData\Roaming\npm-cache\_npx\1696" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ola Andersson\AppData\Roaming\npm-cache\_logs\2018-02-19T09_10_03_239Z-debug.log
Install for create-react-app@latest failed with code 1

Npm error log:

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'prefix@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\Ola',
1 verbose cli   'Andersson\\AppData\\Roaming\\npm-cache\\_npx\\19436',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json' ]
2 info using npm@5.6.0
3 info using node@v9.5.0
4 verbose npm-session 2ab654195912f881
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file:Andersson\AppData\Roaming\npm-cache\_npx\19436 Could not install from "Andersson\AppData\Roaming\npm-cache\_npx\19436" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npmjs.org/prefix 335ms (from cache)
9 silly pacote tag manifest for prefix@latest fetched in 458ms
10 verbose stack Error: ENOENT: no such file or directory, open 'C:\github\Andersson\AppData\Roaming\npm-cache\_npx\19436\package.json'
11 verbose cwd C:\github
12 verbose Windows_NT 10.0.16299
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "prefix@latest" "--global" "--prefix" "C:\\Users\\Ola" "Andersson\\AppData\\Roaming\\npm-cache\\_npx\\19436" "--loglevel" "error" "--json"
14 verbose node v9.5.0
15 verbose npm  v5.6.0
16 error code ENOLOCAL
17 error Could not install from "Andersson\AppData\Roaming\npm-cache\_npx\19436" as it does not contain a package.json file.
18 verbose exit [ 1, true ]

Reproducible Demo

@heyimalex
Copy link
Contributor

Looks like the issue is with npx.

@Timer Timer closed this as completed Mar 5, 2018
@Timer
Copy link
Contributor

Timer commented Mar 5, 2018

Closing as unactionable by us.

@vishalthakurit
Copy link

vishalthakurit commented Aug 21, 2018

This is an issue with npx. Your computer name has a space in it. See this issue in the npx repo for more info. It is unresolved, unfortunately. I'd recommend npm install -g create-react-app to get around the npx issue.
after that run this command:- npx create-react-app my-app

@philson-philip
Copy link

The above error is due the white space contain in your username of PC. The command npx create-react-app doesn't work in this situation and shows error. I have fixed the error and created my first react app.
https://github.com/philson-philip/react-skills
Check the above link for solving the problem and creating your first app with react. Commands are detailed in the README.md file.

@edisgreat
Copy link

I had a similar error on Ubuntu WSL on Windows 10, and tried just dropping npx, so calling just

create-react-app tutorial-react

and it seems to work now

@mrmckeb
Copy link
Contributor

mrmckeb commented Dec 25, 2018

I should say that I'm using npx on WSL and not having any issues. So it definitely seems to be an npx issue sadly :/

To give yourself less headaches in future, you could rename your computer?

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants