一.下载安装nodejs
官网地址:Node.js — 在任何地方运行 JavaScript
二.下载安装vscode代码编辑器
官网地址:Download Visual Studio Code - Mac, Linux, Windows
三.修改本地脚本策略
1,windows+i 打开电脑设置
2,输入powershell
3,开启
四.正题:
简单命令的使用:
1,查看环境版本
node -v
npm -v
2,安装和卸载第三方包
npm install crypto-js
npm uninstall crypto-js
3,查看包版本
npm list // 查看所有
npm list crypto-js
4,换源
npm config get registry // 查看当前的源
npm config set registry https://registry.npmmirror.com // 换成国内淘宝源
npm update // 更新所有下载的模块
npm update crypto-js // 后面跟模块就是更新某个模块
5,安装国内版的npm,由淘宝团队开发(进阶操作,适合安装很大的第三方库)
npm install -g cnpm --registry-https://registry.npmmirror.com
cnpm install crypto-js