Node.js 和 NPM 的安装和配置
文章目录
Node.js 的安装
CentOS安装:
$ dnf module list nodejs
$ dnf module install nodejs:14Windows 安装:
https://nodejs.org/en/download/
查看安装版本:
$ node -vNPM 的安装
Node.js 内置了 NPM 包管理工具,无需单独安装。
查看安装版本:
$ npm -v升级 npm 到最新版本:
$ npm install npm -g配置 NPM 使用淘宝镜像源
临时使用
$ npm install express --registry https://registry.npm.taobao.org永久使用
$ npm config set registry https://registry.npm.taobao.org
$ npm config get registry
$ npm info express恢复为原来的官方地址
$ npm config set registry https://registry.npmjs.org使用 cnpm 代替
$ npm install cnpm -g --registry=https://registry.npm.taobao.org
$ cnpm install express
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论