配置
1、.npmrc 文件中修改 可以缓解Install.js部分卡死状况 需要先设置过一个仓库才会出现npmrc文件
registry=https://registry.npm.taobao.org
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
electron_mirror="https://npm.taobao.org/mirrors/electron/"
2、npm config set registry https://registry.npm.taobao.org 把npm 设置成淘宝镜像下载快点
3、搜索Eslint disable
settings-》code style->java script-> 改成2格
方法后空一格
插件
1、rimraf 快速删除文件
rimraf node_modules
2、npm install -g increase-memory-limit 内存溢出
还需要输入 increase-memory-limit
3、
知识
1、如果下载不了 比如卡在 index.js 可以使用 npm install --ignore-scripts 来忽略package.json中的脚本来完成下载
2、npm config set registry https://registry.npm.taobao.org 把npm 设置成淘宝镜像
2.1、可以通过npm get registry 获取当前镜像网址
3、vue -V 查看最新的vue 版本
4、cnpm -v 可以看npm和vue相关的版本
5、我的电脑——》user——》用户名例如Administrator——》.npmrc 存放你的npm 配置的信息例如registry 或者说prefix
6、libpng-dev 仅在macos 和 linux 所以如果使用 pngaunt-bin 6.0版本会出现异常 libpng-dev在windows下不了
7、下载3.0版本的pngaunt-bin
npm install --save-dev pngquant --msvs_version=2013
8、npm install @babel/core @babel/preset-env js文件编辑器
9、 webpack4.20.0以上版本要使用3.1.1版本的webpack-cli
10、npm install xxx@1.1.1
11、npm list xxx 找不到 可以先全局安装 npm install xxx -g 再局部安装npm install xxx --save-dev
12、Yarn是Facebook最近发布的一款依赖包安装工具。Yarn是一个新的快速安全可信赖的可以替代NPM的依赖管理工具
//在NPM 中安装
npm install -g yarn (使用-g为全局安装,如果没有加参数默认为局部安装,则仅当前文件夹可以使用yarn)
13、npm从国外服务器下载,容易出现异常,可以切换成cnpm,从淘宝下载
npm install -g cnpm --registry=htttps://registry.npm.taobao.org
14、ctrl打开的有个p图标的位置在js当中
15/环境配置
直接node 的文件夹
异常
1、babel-plugin-transform-vue-jsx
npm install babel-plugin-transform-vue-jsx --save-dev
2、The engine "node" is incompatible with this module. Expected version "=> ^4.0.0".
yarn install --ignore-engines