当前位置:网站首页>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 .
边栏推荐
- Verification failed, please check your call back website. You can follow the instructions
- (POJ - 1308)Is It A Tree? (tree)
- Don't spend money, spend an hour to build your own blog website
- Android kotlin fragment technology point
- [usaco05jan]watchcow s (Euler loop)
- What are eNB, EPC and PGW?
- On flow delivery between microservices
- Solve "sub number integer", "jump happily", "turn on the light"
- D为何链接不了dll
- uniapp小程序 subPackages分包配置
猜你喜欢
De4000h storage installation configuration
Web Foundation
BeanUtils--浅拷贝--实例/原理
Unity small map production [2]
Will your sleep service dream of the extra bookinfo on the service network
Research shows that "congenial" is more likely to become friends
rxjs Observable 自定义 Operator 的开发技巧
(POJ - 1984) navigation nightare (weighted and search set)
Essential for operation and maintenance - Elk log analysis system
为什么switch 的default后面要跟break?
随机推荐
故事点 vs. 人天
Can automatically update the universal weekly report template, you can use it with your hand!
验证失败,请检查您的回电网址。您可以按照指导进行操作
Operation tutorial: how does easydss convert MP4 on demand files into RTSP video streams?
[cloud native database] what to do when encountering slow SQL (Part 1)?
Why is the default of switch followed by break?
selenium,元素操作以及浏览器操作方法
Answer: can the audio be set to on by default during easydss video on demand?
刚好1000粉丝,记录一下
MySQL -- convert rownum in Oracle to MySQL
Daily practice of C language --- monkeys divide peaches
[template] longest common subsequence ([DP or greedy] board)
Partner cloud form strong upgrade! Pro version, more extraordinary!
693. Travel sequencing (map + topology)
能自动更新的万能周报模板,有手就会用!
Essential for operation and maintenance - Elk log analysis system
Don't spend money, spend an hour to build your own blog website
Dingtalk send message
2022 zero code / low code development white paper [produced by partner cloud] with download
Memory management 01 - link script