当前位置:网站首页>Error: eacces: permission denied, access to "/usr/lib/node_modules"
Error: eacces: permission denied, access to "/usr/lib/node_modules"
2022-07-02 13:48:00 【Big front end journey】
error :EACCES: Permission denied , visit “/usr/lib/node_modules”
I'm trying to use it today command install typescript npm install -g typescript, It returns this error :
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/n
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/n'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/n'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/n'
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!
Specific error report

After reading, only
So is there a corresponding solution , The answer, of course, is yes , Next, let's look at the moves
Create a directory for the global installation :
mkdir ~/.npm-global
To configure npm To use the new directory path :
npm config set prefix '~/.npm-global'
Open or create a ~/.profile File and add the following lines :
open ~/.profile
export PATH=~/.npm-global/bin:$PATH
Back to the command line , Update system variables :
source ~/.profile
test : Without using sudo Download a package globally .
npm install -g typescript
If you are using Z shell (Zsh), Please add export PATH=~/.npm-global/bin:$PATH Into your file ~/.zshrc
Good success solves the problem .
So learning is about meeting problems , The process of solving problems , Come on, boy , Believe you can .
边栏推荐
- Browser driven Download
- I did it with two lines of code. As a result, my sister had a more ingenious way
- [true topic of the Blue Bridge Cup trials 43] scratch space flight children's programming explanation of the true topic of the Blue Bridge Cup trials
- Web基础
- P1347 排序(拓扑 + spfa判断环 or 拓扑[内判断环])
- Countermeasures for the failure of MMPV billing period caused by negative inventory of materials in SAP mm
- Origin绘制热重TG和微分热重DTG曲线
- How much do you know about free SSL certificates? The difference between free SSL certificate and charged SSL certificate
- Which do you choose between Alibaba P7 with an annual salary of 900000 and deputy department level cadres?
- What are eNB, EPC and PGW?
猜你喜欢
随机推荐
How much do you know about free SSL certificates? The difference between free SSL certificate and charged SSL certificate
[USACO05JAN]Watchcow S(欧拉回路)
Stone merging Board [interval DP] (ordinary stone Merging & Ring Stone merging)
Student course selection information management system based on ssm+jsp framework [source code + database]
题解《子数整数》、《欢乐地跳》、《开灯》
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
Why is the default of switch followed by break?
Development skills of rxjs observable custom operator
D how to check null
Use bloc to build a page instance of shutter
Everyone believes that the one-stop credit platform makes the credit scenario "useful"
Qt-制作一个简单的计算器-实现四则运算
题解:《压缩技术》(原版、续集版)
Download files and preview pictures
A better database client management tool than Navicat
Answer: can the audio be set to on by default during easydss video on demand?
(POJ - 1308)Is It A Tree? (tree)
The second anniversary of the three winged bird: the wings are getting richer and the take-off is just around the corner
Android kotlin broadcast technology point
瀏覽器驅動的下載




![[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术](/img/a7/44609a5acf25021f1fca566c3d8c90.png)



