当前位置:网站首页>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 .
边栏推荐
- What are eNB, EPC and PGW?
- 2022 zero code / low code development white paper [produced by partner cloud] with download
- Node.js通过ODBC访问PostgreSQL数据库
- 题解:《压缩技术》(原版、续集版)
- Research shows that "congenial" is more likely to become friends
- Error function ERF
- Answer: can the audio be set to on by default during easydss video on demand?
- The 29 year old programmer in Shanghai was sentenced to 10 months for "deleting the database and running away" on the day of his resignation!
- Explanation: here is your UFO, Goldbach conjecture
- Bridge of undirected graph
猜你喜欢

Can automatically update the universal weekly report template, you can use it with your hand!

Daily practice of C language --- monkeys divide peaches

题解《子数整数》、《欢乐地跳》、《开灯》

伙伴云表格强势升级!Pro版,更非凡!

Qt-制作一个简单的计算器-实现四则运算-将结果以对话框的形式弹出来

Qt入门-制作一个简易的计算器

Node. JS accessing PostgreSQL database through ODBC

Everyone believes that the one-stop credit platform makes the credit scenario "useful"

瀏覽器驅動的下載

Countermeasures for the failure of MMPV billing period caused by negative inventory of materials in SAP mm
随机推荐
P3008 [usaco11jan]roads and planes g (SPFA + SLF optimization)
(POJ - 1308)Is It A Tree? (tree)
D language, possible 'string plug-ins'
P3008 [USACO11JAN]Roads and Planes G (SPFA + SLF优化)
Will your sleep service dream of the extra bookinfo on the service network
Drawing Nyquist diagram with MATLAB
Integral link, inertia link and proportion link in Simulink
(POJ - 1984) navigation nightare (weighted and search set)
Principle analysis of security rememberme
大家信夫一站式信用平台让信用场景“用起来
Redis数据库持久化
SSL证书的分类有哪些?如何选择合适的SSL证书?
Can automatically update the universal weekly report template, you can use it with your hand!
[USACO05JAN]Watchcow S(欧拉回路)
[cloud native database] what to do when encountering slow SQL (Part 1)?
Answer: can the audio be set to on by default during easydss video on demand?
刚好1000粉丝,记录一下
能自动更新的万能周报模板,有手就会用!
伙伴云表格强势升级!Pro版,更非凡!
[indomitable medal activity] life goes on and writing goes on