lyanm
lyanm

Reputation: 43

What's wrong with "command not found: create-nuxt-app"

When I use npx to create a Nuxt.js program

PS D:\vue\miniProgram\mt-app> npx create-nuxt-app mt-app
Error: EPERM: operation not permitted, mkdir 'C:\Users\Slade'
command not found: create-nuxt-app

PS. CLI:Windows PowerShell

Upvotes: 4

Views: 6884

Answers (3)

Solomon Sitotaw
Solomon Sitotaw

Reputation: 77

Change npm temp cache directory:

npm config set cache C:\tmp\nodejs\npm-cache --global

Upvotes: 0

npm install -g create-nuxt-app

npm create-nuxt-app <app_Name>

Upvotes: 4

vintprox
vintprox

Reputation: 1141

I assume you have spaces in username. There are still issues regarding it. You'll need to work around it at the time.

  1. Open C:\Users\Slade with Space\.npmrc.
  2. Modify locations:
    prefix=C:\Users\Sladew~1\AppData\Roaming\npm
    cache=C:\Users\Sladew~1\AppData\Roaming\npm-cache
    
    globalconfig=C:\Users\Sladew~1\AppData\Roaming\npm\etc\npmrc
    init-module=C:\Users\Sladew~1\.npm-init.js
    tmp=C:\Users\Sladew~1\AppData\Local\Temp
    userconfig=C:\Users\Sladew~1\.npmrc
    globalignorefile=C:\Users\Sladew~1\AppData\Roaming\npm\etc\npmignore
    
    I suppose many of them may be omitted, but important part here is setting of prefix and cache: if you intend to have username with spaces, it's no problem in referring to it as Sladew~1 (according to the results of dir /x).

Upvotes: 2

Related Questions