node安装
https://nodejs.org/en/download/ 下载node后按照指示进行安装
安装完毕后打开命令提示符,能查看版本即为安装成功
$ node -v
v10.16.3
$ npm -v
6.9.0
全局安装路径配置
//prefix与路径之间有空格,否则回配置失败,配置插件安装路径
npm config set prefix “D:\nodejs\node_modules\node_global”
//配置缓存cache路径
npm config set cache “D:\nodejs\node_modules\node_cache”
环境变量配置
1.系统变量中新增NODE-PATH,变量值:“node_gloabal路径/node_modules”;
2.用户变量中修改Path变量
验证全局配置是否安装成功
npm config get prefix
npm config get cache
进行安装webpack时发生错误 npm install webpack -g
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/webpack failed, reason: unable to verify the first certificate
npm ERR! A complete log of this run can be found in:
npm ERR! D:\develop\nodejs\node_cache\_logs\2019-09-19T06_28_52_455Z-debug.log
原因:在unable to verify the first certificate
无法验证第一证书
因为npm install走的是https协议,需要通过数字证书来保证的
解决方法:
取消ssl验证
npm config set strict-ssl false
如果还没成功,则将npm源更换为国内镜像:
npm config set registry http://registry.cnpmjs.org/
npm config set registry http://registry.npm.taobao.org/
参考文章:npm总是报错:unable to verify the first certificate
npm查看仓库源:
//查看源,可以看到设置过的所有的源
npm config get registry
npm 设置仓库源:
npm config set registry [仓库地址]
cnpm
cnpm配置安装淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
webpack
npm install webpack -g
老版本到此已经安装完成,但新版本中将CLI(命令行工具)转移到了一个单独的包中,所以我们还需要安装webpack-cli。(注意:webpack-cli也要对应进行全局安装)
npm install webpack-cli -g
webpack安装完成后可以在命令行进行查看版本,至此webpack安装成功
webpack -v
git安装
http://git-scm.com/download/win 下载git后按照指示进行安装即可
sublime text3安装配置
官网下载安装好
常用插件的安装及使用:HTML5中sublime Text3的常用插件的安装及使用
有了Package-Control : Install Package之后,插件的安装就很方便
ctrl + shift + P 然后搜索Install 找到Package-Control : Install Package,就可以查找需要的插件了