[BUG] NPX doesnt work if path has any spaces in it
ItsRauf opened this issue · 6 comments
ItsRauf commented
What / Why
When running npx in a path that has spaces in it, npx fails
Current Behavior
- fails with
Error: EPERM: operation not permitted, mkdir 'C:\Users\Rauf'
Steps to Reproduce
- have a path with a space in it (ex: C;\Users\Rauf Islam\code\portfolio)
Expected Behavior
- npx should continue after the space to get the full path
rrgore commented
Hi,
I would like to work on this issue. Please assign it to me.
Thanks.
brianpeiris commented
There was a PR for this in the previous repo. See zkat/npx#181, zkat/npx#138 and zkat/npx#100
humblefool96 commented
Run CMD in administrator mode and fire below commands in order
- Run cmd as administrator
- Run npm config edit (You will get notepad editor)
- Change prefix variable to C:\Users<User Name>\AppData\Roaming\npm
- npm install -g create-react-app
Thanks.
fauzanelka commented
I think I've found the solution:
- Run
npm config edit
- Add these lines:
cache=C:\Users\Rauf~1\AppData\Roaming\npm-cache
globalconfig=C:\Users\Rauf~1\AppData\Roaming\npm\etc\npmrc
init-module=C:\Users\Rauf~1\.npm-init.js
tmp=C:\Users\Rauf~1\AppData\Local\Temp
userconfig=C:\Users\Rauf~1\.npmrc
globalignorefile=C:\Users\Rauf~1\AppData\Roaming\npm\etc\npmignore
mrinalpathak16 commented
I found this useful and working for me -
https://stackoverflow.com/a/46871748/12581294
andremarcondesteixeira commented
If there were already PR's fixing this, when will the fix be released?