Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

[BUG] NPX doesnt work if path has any spaces in it #14

Open
ItsRauf opened this issue Oct 27, 2019 · 6 comments
Open

[BUG] NPX doesnt work if path has any spaces in it #14

ItsRauf opened this issue Oct 27, 2019 · 6 comments

Comments

@ItsRauf
Copy link

ItsRauf commented Oct 27, 2019

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
Copy link

rrgore commented Dec 7, 2019

Hi,
I would like to work on this issue. Please assign it to me.
Thanks.

@brianpeiris
Copy link

There was a PR for this in the previous repo. See zkat/npx#181, zkat/npx#138 and zkat/npx#100

@humblefool96
Copy link

Run CMD in administrator mode and fire below commands in order

  1. Run cmd as administrator
  2. Run npm config edit (You will get notepad editor)
  3. Change prefix variable to C:\Users<User Name>\AppData\Roaming\npm
  4. npm install -g create-react-app
    Thanks.

@fauzanelka
Copy link

I think I've found the solution:

  1. Run npm config edit
  2. 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
Copy link

I found this useful and working for me -
https://stackoverflow.com/a/46871748/12581294

@andremarcondesteixeira
Copy link

If there were already PR's fixing this, when will the fix be released?

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