Manjaro下安装配置NPM源 Registry的正确姿势

本文介绍了在Manjaro Linux中正确配置NPM源Registry的方法。当尝试用NPM创建Angular项目时遇到无法更改默认registry的问题,通过编辑或创建~/.npmrc文件并设置registry,可以实现对npm源的定制。执行`npm config set registry <你的源>`并确认配置生效,确保在使用npm时不再依赖默认registry。
摘要由CSDN通过智能技术生成

自从上次在Vmware中成功安装Manjaro, 我感觉用来作为敲代码的环境还是非常舒服的.

但今天在尝试在Linux下使用NPM创建Angular项目的时候, 出现了问题 - 无法改变默认的npm的默认registry.

经过我的实验, 单纯使用

npm config set registry <https://registry.npm.taobao.org>

是无法起到彻底更改registry的效果的. 即便之后执行命令

npm config get registry

时显示registry为你设置的源.

正确姿势:

在shell中执行npm命令, 有如下结果

[zrh-vmwarevirtualplatform ~]# npm
npm <command>

Usage:

npm install        install all the dependencies in your project
npm install <foo>  add the <foo> dependency to your project
npm test           run this project's tests
npm run <foo>      run the script named <foo>
npm <command> -h   quick help on <command>
npm -l             display usage info for all commands
npm help <term>    search for help on <term>
npm help npm       more involved overview

All commands:

    access, adduser, audit, bin, bugs, 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值