LoginSignup
6
4

More than 5 years have passed since last update.

vue-cliでエラーが表示され、プロジェクトを作成することができない。

Last updated at Posted at 2018-01-16
npm install -g vue-cli

このコマンドを打つと、盛大にエラーがでた。

npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "vue-cli"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! path /usr/local/lib/node_modules/vue-cli/node_modules/abbrev
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/vue-cli/node_modules/abbrev'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/vue-cli/node_modules/abbrev'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/vue-cli/node_modules/abbrev' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/名前/Desktop/git/フォルダ/npm-debug.log
masashi-macbook:フォルダ 名前$ vue init webpack my-project

続くプロジェクトを作成するコマンドもエラーを返してしまい、 npm run dev できない。

一生懸命調べた結果、

sudo npm install -g vue-cli

これで解決した。
あとは今まで通り

vue init webpack tutorial_vuejs_todo_management 

このコマンドで先に進めます

6
4
2

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
6
4