日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

Mac电脑使用:通过Mac终端安装淘宝镜像报错,提示无权限的解决方法

發(fā)布時(shí)間:2023/12/19 综合教程 38 生活家
生活随笔 收集整理的這篇文章主要介紹了 Mac电脑使用:通过Mac终端安装淘宝镜像报错,提示无权限的解决方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

最近在開發(fā)過程中,遇到了給Mac電腦裝淘寶鏡像遇到的一個(gè)無權(quán)限問題,也就是Mac電腦的終端默認(rèn)情況下打開的是普通用戶模式,安裝淘寶鏡像需要打開管理員模式才行,所以在執(zhí)行命令的時(shí)候不用管理員模式的話,就會(huì)提示無權(quán)限。

本篇博文就來分享一下解決安裝淘寶鏡像的時(shí)候提示無權(quán)限的方法,其實(shí)只要在執(zhí)行安裝淘寶鏡像命令前面加上管理員權(quán)限就行了,具體的報(bào)錯(cuò)提示以及解決方法如下所示。

Mac電腦終端執(zhí)行下載安裝淘寶鏡像命令:npm install -g cnpm --registry=https://registry.npm.taobao.org 之后的報(bào)錯(cuò)無權(quán)限的提示如下所示:

Mac-mini:~ Chen$ npm install -g cnpm --registry=https://registry.npm.taobao.org

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /usr/local/lib/node_modules

npm ERR! errno -13

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!

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.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/Chen/.npm/_logs/2020-01-11T01_02_02_782Z-debug.log

上述問題的解決步驟:

使用這個(gè)命令:sudo npm install -g express-generator 也會(huì)有問題;

使用這個(gè)命令:sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose 就可以安裝成功了。

安裝成功提示如下所示:

npm timing action:postinstall Completed in 219ms

npm verb unlock done using /Users/Chen/.npm/_locks/staging-3a08f84d.lock for /usr/local/lib/node_modules/.staging

npm timing stage:executeActions Completed in 10194ms

npm timing stage:rollbackFailedOptional Completed in 2ms

npm timing stage:runTopLevelLifecycles Completed in 19473ms

+ cnpm@6.1.1

added 681 packages from 942 contributors in 19.477s

npm verb exit [ 0, true ]

npm timing npm Completed in 20072ms

npm info ok

總結(jié)

以上是生活随笔為你收集整理的Mac电脑使用:通过Mac终端安装淘宝镜像报错,提示无权限的解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。