1. 查看全局安装路径
npm root -g
2. 修改全局安装路径
npm config set prefix "一般为nodejs安装路径"
会自动将组件下载到这个目录下的node_modules目录里去
3. 修改缓存路径
npm config set cache "一般为nodejs安装路径\node_cache"
4. 安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
5. cnpm : 无法加载文件 D:\Program Files\nodejs\cnpm.ps1,因为在此系统上禁止运行脚本。
1、以管理员身份运行powershell
2、在powershell执行:get-ExecutionPolicy,显示Restricted(表示状态是禁止的)
3、在powershell执行:set-ExecutionPolicy RemoteSigned ,选择Y或A
4、在powershell执行:get-ExecutionPolicy,显示RemoteSigned
6.安装vue-cli脚手架
cnpm install -g @vue/cli
7.创建vue项目
vue create firstapp