当前位置:网站首页>安装nrm后,使用nrm命令报错internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
安装nrm后,使用nrm命令报错internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
2022-06-28 08:06:00 【庸懒】
最近需要切换不同的npm源,因为有私有的,如果重新配就很麻烦,然后我安装了一个nrm,但是在安装完毕运行的时候报错了。错误如图所示:
这个时候得先检查node、npm有没有问题,如果没有问题的话再看这一行错误at Object.<anonymous> (D:\Node.js\node_global\node_modules\nrm\cli.js:17:20)
然后根据这个路径打开cli.js文件,就是下面第三行的js文件
根据报错可以知道是第17行出了问题,这时候需要将17行的代码换成下面的代码:
// const NRMRC = path.join(process.env.HOME, '.nrmrc');
const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');
这个时候在打开cmd输入nrm ls就可以看到出现了相关源的信息
边栏推荐
猜你喜欢

Kubernetes cluster command line tool kubectl

SQL analysis (query interception analysis for SQL optimization)

Do you know TCP protocol (2)?

Configuring MySQL multi instance master-slave synchronization for Linux

At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions

Three step problem of leetcode

Connaissez - vous le protocole TCP (2)?

Redis cluster deployment and application scenarios

App automated testing appium tutorial 2 - ADB command

Airflow2 configuration windows azure SSO details based on oauth2 protocol
随机推荐
【js】-【DFS、BFS应用】-学习笔记
HJ进制转换
flex布局
Kubernetes theoretical basis
Host is not allowed to connect to this MySQL server
Is it reliable to open a new bond registration account? Is it safe?
Eslint syntax monitoring off
Image translation /transformer:ittr: unpaired image to image translation with transformers
Porting ucosiii to stm32f429
Airflow2.1.1 summary of the pits stepped on in actual combat!!
同花顺注册开户靠谱吗?安全吗?
flex布局
云原生:云计算技术再次升级 开启全面云开发时代
[shangpinhui] project notes
MySQL implements transaction persistence using redo logs
【学习笔记】模拟
【学习笔记】线性基
匿名页的反向映射
Configuring MySQL multi instance master-slave synchronization for Linux
HJ成绩排序