当前位置:网站首页>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 .
边栏推荐
- JS reverse massive creative signature
- Android kotlin material design technology points
- How to use SAP's metadata framework (MDF) to build custom business rules?
- leetcode621. task scheduler
- Answer: can the audio be set to on by default during easydss video on demand?
- OpenApi-Generator:简化RESTful API开发流程
- Error function ERF
- 693. Travel sequencing (map + topology)
- Qt-制作一个简单的计算器-实现四则运算-将结果以对话框的形式弹出来
- Achievements in science and Technology (27)
猜你喜欢

题解:《压缩技术》(原版、续集版)

Origin绘制热重TG和微分热重DTG曲线
![[OpenGL] notes 29. Advanced lighting (specular highlights)](/img/6e/56bc7237f691a4355f0b7627b3003e.png)
[OpenGL] notes 29. Advanced lighting (specular highlights)

Bridge of undirected graph

OpenFOAM:lduMatrix&lduAddressing

ensp简单入门

Tupang multi-target tracking! BOT sort: robust correlated multi pedestrian tracking

Web基础

Why is the default of switch followed by break?

伙伴云表格强势升级!Pro版,更非凡!
随机推荐
JS reverse massive creative signature
Research shows that "congenial" is more likely to become friends
Everyone believes that the one-stop credit platform makes the credit scenario "useful"
Selenium installing selenium in pycharm
How to modify the error of easydss on demand service sharing time?
JS reverse row query data decryption
每日一题:1175.质数排列
SSL证书的分类有哪些?如何选择合适的SSL证书?
Android kotlin material design technology points
The second anniversary of the three winged bird: the wings are getting richer and the take-off is just around the corner
二、帧模式 MPLS 操作
2022 Heilongjiang provincial examination on the writing skills of Application Essays
【文档树、设置】字体变小
P1347 排序(拓扑 + spfa判断环 or 拓扑[内判断环])
693. 行程排序(map + 拓扑)
Chinese name extraction (toy code - accurate head is too small, right to play)
The xftp connection Haikang camera reported an error: the SFTP subsystem application has been rejected. Please ensure that the SFTP subsystem settings of the SSH connection are valid
使用BLoC 构建 Flutter的页面实例
selenium的特点
三谈exception——错误处理