成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

mac Os下全局安裝vue cli3.0出現(xiàn)的報(bào)錯(cuò)解決方案

AlphaWatch / 2487人閱讀

摘要:直接全局安裝是會(huì)出現(xiàn)錯(cuò)誤錯(cuò)誤如下這種錯(cuò)誤提示是你沒(méi)有權(quán)限將安裝文件直接寫入一個(gè)權(quán)限控制文件里。

直接 npm install -g @vue/cli全局安裝是會(huì)出現(xiàn)錯(cuò)誤

錯(cuò)誤如下:

Last login: Tue Oct 30 23:43:58 on ttys000
asusdeMac:~ asus$ npm install -g @vue/cli
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN [email protected] requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/[email protected] requires a peer of graphql@^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access "/usr/local/lib/node_modules"
npm ERR!  { Error: EACCES: permission denied, access "/usr/local/lib/node_modules"
npm ERR!   stack: "Error: EACCES: permission denied, access "/usr/local/lib/node_modules"",
npm ERR!   errno: -13,
npm ERR!   code: "EACCES",
npm ERR!   syscall: "access",
npm ERR!   path: "/usr/local/lib/node_modules" }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/asus/.npm/_logs/2018-10-31T06_48_54_915Z-debug.log

這種錯(cuò)誤提示是你沒(méi)有權(quán)限將安裝文件直接寫入一個(gè)權(quán)限控制文件里。

npm全局安裝文件時(shí)可以使用 ‘sudo’ 任何管理員賬戶都可以使用sudo來(lái)獲取 root 權(quán)限。

使用 sudo npm install -g @vue/cli 進(jìn)行安裝

1、輸入安裝命令后,命令提醒你輸入Password密碼,目的使用管理員權(quán)限去安裝

Last login: Tue Oct 30 23:44:47 on ttys000
asusdeMac:~ asus$ sudo npm install -g @vue/cli

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:

密碼輸入完后稍等一會(huì)兒就安裝成功啦!

asusdeMac:~ asus$ sudo npm install -g @vue/cli
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
/usr/local/bin/vue -> /usr/local/lib/node_modules/@vue/cli/bin/vue.js

> [email protected] install /usr/local/lib/node_modules/@vue/cli/node_modules/fsevents
> node install

[fsevents] Success: "/usr/local/lib/node_modules/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/protobufjs
> node scripts/postinstall


> [email protected] postinstall /usr/local/lib/node_modules/@vue/cli/node_modules/nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN [email protected] requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @apollographql/[email protected] requires a peer of graphql@^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of graphql@^0.13.0 but none is installed. You must install peer dependencies yourself.

+ @vue/[email protected]
added 730 packages from 514 contributors in 167.036s

檢測(cè)是否在全局安裝成功 輸入命令 vue -v

asusdeMac:~ asus$ vue -v
Usage: vue  [options]

Options:
  -V, --version                         output the version number
  -h, --help                            output usage information

Commands:
  create [options]            create a new project powered by vue-cli-service
  add  [pluginOptions]          install a plugin and invoke its generator in an already created project
  invoke  [pluginOptions]       invoke the generator of a plugin in an already created project
  inspect [options] [paths...]          inspect the webpack config in a project with vue-cli-service
  serve [options] [entry]               serve a .js or .vue file in development mode with zero config
  build [options] [entry]               build a .js or .vue file in production mode with zero config
  ui [options]                          start and open the vue-cli ui
  init [options]