摘要:直接全局安裝是會(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] generate a project from a remote template (legacy API, requires @vue/cli-init) config [options] [value] inspect and modify the config Run vue --help for detailed usage of given command. Unknown option -v.
接下來(lái)你就可以進(jìn)行你的vue.js腳手架搭建啦
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/98872.html
摘要:下面來(lái)就來(lái)講講腳手架的安裝吧。如何安裝安裝只需要在終端下輸入下面一條命令自帶不需要安裝安裝完成后使用即可。原因是的問(wèn)題,要求版本是。想用安裝,就必須用安裝一下。 前言 Vue作為前端三大框架(Angular,React,Vue)之一,號(hào)稱是最簡(jiǎn)單,最容易上手的框架,同時(shí)也是行內(nèi)的大趨勢(shì),還可以用來(lái)開(kāi)發(fā)最火的小程序。具有開(kāi)發(fā)快,雙向數(shù)據(jù)流等特點(diǎn),有些人認(rèn)為Vue是Angular和Reac...
摘要:下面來(lái)就來(lái)講講腳手架的安裝吧。如何安裝安裝只需要在終端下輸入下面一條命令自帶不需要安裝安裝完成后使用即可。原因是的問(wèn)題,要求版本是。想用安裝,就必須用安裝一下。 前言 Vue作為前端三大框架(Angular,React,Vue)之一,號(hào)稱是最簡(jiǎn)單,最容易上手的框架,同時(shí)也是行內(nèi)的大趨勢(shì),還可以用來(lái)開(kāi)發(fā)最火的小程序。具有開(kāi)發(fā)快,雙向數(shù)據(jù)流等特點(diǎn),有些人認(rèn)為Vue是Angular和Reac...
摘要:中使用和不是特別符合原生的寫法,但是有時(shí)候又要用,所以放上我的引入設(shè)置,供大家參考。其中用于在中顯示彈窗提示下拉菜單,所以需要引入。因?yàn)槲业奈募?jīng)過(guò)了我自己的調(diào)整,所以單獨(dú)放在文件夾中做單獨(dú)引入。 Vue 中使用 jQuery 和 Bootstrap 不是特別符合 Vue 原生的寫法,但是有時(shí)候又要用,所以放上我的引入設(shè)置,供大家參考。 在 Vue CLI2.0 中引入 jQuery ...
閱讀 2444·2021-11-16 11:44
閱讀 1930·2021-10-12 10:12
閱讀 2237·2021-09-22 15:22
閱讀 3042·2021-08-11 11:17
閱讀 1541·2019-08-29 16:53
閱讀 2683·2019-08-29 14:09
閱讀 3501·2019-08-29 14:03
閱讀 3367·2019-08-29 11:09