npm/npx

[BUG] npx error caused by a single quote in username

Opened this issue · 2 comments

I'm trying to install react native, whenever I execute npx react-native init AwesomeProject
I get

`npm ERR! code ENOLOCAL
npm ERR! Could not install from "HP\AppData\Roaming\npm-cache_npx\2732" 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\Fouad's HP\AppData\Roaming\npm-cache_logs\2020-01-13T01_20_40_146Z-debug.log
Install for react-native@latest failed with code 1`

As you can see, my windows username is "Fouad's HP", and the error shows that it npm could not install from HP\AppData... instead of Fouad'sHP\AppData...

this error occurs with me to, when i try to create a new angular workspace.

windows user profile name bug.

Try this

  1. Run npm config edit
  2. Add these lines:
cache=C:\Users\Fouad's~1\AppData\Roaming\npm-cache
globalconfig=C:\Users\Fouad's~1\AppData\Roaming\npm\etc\npmrc
init-module=C:\Users\Fouad's~1\.npm-init.js
tmp=C:\Users\Fouad's~1\AppData\Local\Temp
userconfig=C:\Users\Fouad's~1\.npmrc
globalignorefile=C:\Users\Fouad's~1\AppData\Roaming\npm\etc\npmignore