npm
npm install 安装依赖
npm run dev 编译js,css等
npm run production 优化
npm run watch-poll 监听(相当于前两句的合并)
npm verufy cache 清楚缓存
npm config set registry "https://registry.npmjs.com/" 设置npm的下载源
npm install --ignore-engines 忽略版本安装依赖
问题:
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/react-is (over 30000ms)
Sounds like you have a slow connection. Try increasing the timeout from 30s to 60s by adding this to your .npmrc
file:( C:\Users\Administrator\.npmrc)
timeout=60000
You could also try adding
prefer-offline=true
npm install时报以下错误
Error: EPERM: operation not permitted, unlink 'E:\phpstudy_pro\WWW\minisoapi2\node_modules\.node-sass.DELETE\vendor\win32-x64-57\binding.node'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
yarn install --ignore-engine 可以解决以上问题,前提是已经安装了yarn
npm安装时有报错问题可以到这里查看https://www.e-learn.cn/tag/npm-install
踩过这个坑,还有下一个坑等着你,这一路就是给自己填坑,坑填多了,也就习惯了,直到这一路平坦了,也就无怨无悔了。