当前位置:网站首页>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 .
边栏推荐
- 【文档树、设置】字体变小
- Characteristics of selenium
- D how to check null
- Android kotlin fragment technology point
- 大家信夫一站式信用平台让信用场景“用起来
- Launcher启动过程
- D为何链接不了dll
- Detailed collection of common MySQL commands
- 2022 zero code / low code development white paper [produced by partner cloud] with download
- How much do you know about free SSL certificates? The difference between free SSL certificate and charged SSL certificate
猜你喜欢

大家信夫一站式信用平台让信用场景“用起来

Use bloc to build a page instance of shutter

混沌工程平台 ChaosBlade-Box 新版重磅发布

Drawing Nyquist diagram with MATLAB

错误:EACCES:权限被拒绝,访问“/usr/lib/node_modules”

Skillfully use SSH to get through the Internet restrictions

Node.js通过ODBC访问PostgreSQL数据库

题解:《你的飞碟在这儿》、《哥德巴赫猜想》

2、 Frame mode MPLS operation

Why is the default of switch followed by break?
随机推荐
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别
How much do you know about free SSL certificates? The difference between free SSL certificate and charged SSL certificate
三谈exception——错误处理
能自动更新的万能周报模板,有手就会用!
Research shows that "congenial" is more likely to become friends
Countermeasures for the failure of MMPV billing period caused by negative inventory of materials in SAP mm
Engineers who can't read device manuals are not good cooks
qt中uic的使用
On flow delivery between microservices
Selenium installing selenium in pycharm
Add sequence number column to query results in MySQL
Launcher启动过程
693. Travel sequencing (map + topology)
Explanation of 34 common terms on the Internet
Principle analysis of security rememberme
Development skills of rxjs observable custom operator
Three talking about exception -- error handling
[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
P3807 [template] Lucas theorem /lucas theorem
Dingtalk send message