下载的nodejs版本10.80
安装nodejs后自带的npm版本为6.2.0
新装的npm需要执行初始化命令来配置一些信息,生成package.json
初始化命令
npm init
会提示输入一些基本信息如名称、国别、许可等等,如果不需要特别设置一路回车即可
配置国内npm镜像源
临时配置:
npm --registry
npm config set registry https://registry.npmmirror.cominstall express
永久配置
npm config set registry
https://registry.npmmirror.com
其他镜像:
npm 官方原始镜像网址是:https://registry.npmjs.org/
淘宝 NPM 镜像:https://registry.npm.taobao.org
阿里云 NPM 镜像:https://npm.aliyun.com
腾讯云 NPM 镜像:https://mirrors.cloud.tencent.com/npm/
华为云 NPM 镜像:https://mirrors.huaweicloud.com/repository/npm/
网易 NPM 镜像:https://mirrors.163.com/npm/
中科院大学开源镜像站:http://mirrors.ustc.edu.cn/
清华大学开源镜像站:https://mirrors.tuna.tsinghua.edu.cn/
2024 提示:淘宝
https://registry.npm.taobao.org
不太稳定了,需要使用新的https://registry.npmmirror.com
npm config get registry
或者
npm info express
地址:https://www.leftso.com/article/499.html