一、下载node环境 (nvm)
https://github.com/coreybutler/nvm-windows/releaseshttps://links.jianshu.com/go?to=https%3A%2F%2Fgithub.com%2Fcoreybutler%2Fnvm-windows%2Freleases 选择:nvm-setup.zip下载
这是一个安装包,下载之后点击安装,无需配置就可以使用,方便。
下载完成安装即可。
二、安装node环境
以管理员身份进入cmd命令
//查看nvm是否安装完成
nvm -v
//安装node环境及npm(版本根据需求选取)
nvm install 12.13.0
//查看是否安装node及npm
npm -v
node -v
安装了有版本号出来
//npm的资源仓库在国内使用过程中,偶尔会遇到各种资源问题,
通常设置为淘宝的镜像,并且用cnpm下载资源。(推荐)
npm install -g cnpm --registry=https://registry.npm.taobao.org
也可以用npm设置淘宝镜像(不推荐)
npm
#查看资源库镜像
npm config get registry
#设置
npm config set registry https://registry.npm.taobao.org
//安装依赖(cd 进入项目目录)
cnpm install
//启动项目
npm start