当前位置:网站首页>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 .
边栏推荐
- 错误:EACCES:权限被拒绝,访问“/usr/lib/node_modules”
- Téléchargement par navigateur
- [indomitable medal activity] life goes on and writing goes on
- 运维必备——ELK日志分析系统
- 伙伴云表格强势升级!Pro版,更非凡!
- Engineers who can't read device manuals are not good cooks
- 题解《子数整数》、《欢乐地跳》、《开灯》
- How much do you know about free SSL certificates? The difference between free SSL certificate and charged SSL certificate
- [USACO05JAN]Watchcow S(欧拉回路)
- Pattern matching and regular expressions in PostgreSQL - Das
猜你喜欢

混沌工程平台 ChaosBlade-Box 新版重磅发布
![[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](/img/42/21f6d0fdd159faa8b63713624c95a2.png)
[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

不会看器件手册的工程师不是个好厨子

ensp简单入门

OpenFOAM:lduMatrix&lduAddressing

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

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

Engineers who can't read device manuals are not good cooks

Everyone believes that the one-stop credit platform makes the credit scenario "useful"
![[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术](/img/a7/44609a5acf25021f1fca566c3d8c90.png)
[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术
随机推荐
伙伴云表格强势升级!Pro版,更非凡!
Clean up system cache and free memory under Linux
Detailed collection of common MySQL commands
Dingtalk send message
Fundamentals of machine learning (II) -- division of training set and test set
(POJ - 1308)Is It A Tree? (tree)
ArrayList and LinkedList
【OpenGL】笔记二十九、高级光照(镜面高光)
混沌工程平台 ChaosBlade-Box 新版重磅发布
mysql ---- Oracle中的rownum转换成MySQL
Download files and preview pictures
How to explain binary search to my sister? This is really difficult, fan!
你的 Sleep 服务会梦到服务网格外的 bookinfo 吗
Quantum three body problem: Landau fall
二、帧模式 MPLS 操作
Solution: Compression Technology (original version and sequel version)
量子三体问题: Landau Fall
P3008 [USACO11JAN]Roads and Planes G (SPFA + SLF优化)
Browser driven Download
[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术