Fails to install on windows 10, whitespace in path issue?
See original GitHub issueIs 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
node -v
: 9.5.0npm -v
: 5.6.0yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected):
Then, specify:
- Operating system: Windows 10
- Browser and version (if relevant):
Steps to Reproduce
- 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
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
White-space in file path causes error when installing/updating ...
My windows username is my real name with a whitespace between. From R 3.6.2 (I think) onwards, this has been an issue with...
Read more >Want to remove white spaces from windows path - Super User
First change your username to remove the white space. ... SID>\ registry key and rename ProfileImagePath to the new user folder path.
Read more >Path cannot be the empty string or all whitespace - TechNet
... when I clic on 'install" at the end of the menu, I have the following error message: "Path cannot be the empty...
Read more >Error when installpath contains space - Advanced Installer
Hi, This happens when you use paths that contain spaces in formatted fields (except the "Application Folder" and "Application Shortcut Folder" ...
Read more >'npx create-react-app myapp' command does not work ...
Windows 10 -> 'npx create-react-app myapp' command does not work because of whitespace username in file path · Ask Question. Asked 3 years,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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?