8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

npx create-nuxt-app でエラー

8
Last updated at Posted at 2019-01-09

Nuxt.jsのcreate-nuxt-appをインストールする際、 npx create-nuxt-app を実行するとエラーがおきてしまったので、対策方法を忘れないうちに。

環境

  • windows 10
  • git Bash
  • node.js v10.15.0
  • npm v6.4.1

原因

↓エラーコード ※一部抜粋

Error: EPERM: operation not permitted, mkdir 'C:\Users\User'

npxのGitを確認。
同じようなエラーがおきてる人が質問してました!
Error: EPERM: operation not permitted, mkdir 'C:\Users\Foo'

どうやらディレクトリ名にスペースがあることでエラーになっているっぽい。
なぜ空白があるとエラーになるかは不明です・・・

C:\Users\User Name\ ← 「User Name」に空白あるのでエラーになった

解決方法

Error: EPERM: operation not permitted, mkdir 'C:\Users\Foo'
この質問に対して、解決策を提案してくれてましたー

I was able to fix this in Windows by creating a directory junction to my users folder that didn't have a space in it. You can run a command like this in an administrative powershell:

> cmd /c mklink /J "C:\Users\myname" "C:\Users\My Name"
> You can then use this junction as if it were your real user directory:
> 
> npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
> npm config set prefix C:\Users\myname\AppData\Roaming\npm

(the above should update your user .npmrc file)

実際に同じように、シンボリックリンクを作成。
npmのパスを変更してnpx create-nuxt-app を実行するとインストールしてくれました!

ただ、その後に「\Users\myname」までのパスがディレクトリ名になった謎のディレクトリが生成されてました…

2019/01/10 追記

謎ディレクトリ問題が解決しないので、npxをあきらめてyarnでパッケージをインストールし直しました。

8
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?