前端常用工具
前端开发常用的一些工具,会一直持续更新。
1.web开发常用网站
vue
react
web
2.icon图标
介绍几个常用图标制作和下载网站
3.颜色
4.npm
4-1.淘宝镜像
默认外国源比较慢,切换国内源下载会快很多
两种修改方式
- 安装时指定
- 修改配置
安装指定源
npm install --registry=https://registry.npm.taobao.org
安装时候,使用
--registry
来指定国内源
修改配置
# 淘宝源
npm config set registry https://registry.npm.taobao.org
# 还原npmjs
npm config set registry https://registry.npmjs.org/
4-2.常用命令
# 在项目中引导创建一个package.json文件
npm init
# 导入package.json全部依赖
npm install # node_modules 中有相应的包则不会重新下载
npm install --force # 强制下载安装
# 安装某个模块
npm install gulp # 最新版本
npm install gulp@3.9.1 # 指定版本
# 卸载模块
npm uninstall gulp
# 查看安装的模块
npm ls
npm ls xx (本地安装的)
# 查看版本
npm view xxx versions (所有版本)
npm view xxx version (最新)
npm info xxxx(所有版本)
5.yarn
Yarm新的一代管理工具
特点
- 速度快
- 版本统一,更安全
- 更简洁
5-1.淘宝镜像
yarn config set registry http://registry.npm.taobao.org
5-2.常用命令
# 开始一个新工程
yarn init
# 导入package.json全部依赖
yarn 或 yarn install # node_modules中有相应的包则不会重新下载
yarn install --force # 强制下载安装
# 添加一个依赖
yarn add xx
# 移除一个依赖
yarn remove xx
# 更新
yarn upgrade
yarn upgrade xx
yarn upgrade xxx@^1.0.0
# 查看包的信息
yarn info react
yarn info react --json # json化一下
yarn info react@15.3.0 # 查看指定版本
5-3.yarn和npm比较
npm | install |
---|---|
npm init | yarn init |
npm install | yarn |
npm install xxx –save | yarn add xx |
npm uninstall xxx –save | yarn remove xxx |
npm install xxx –save-dev | yarn add xxx –dev |
npm update –save | yarn upgrage |
99.常见问题
99-1.问题1
问题:
npm ERR! code ELIFECYCLE
解决方法:
npm cache clean --force
rm -rf node_modules
rm -rf package-lock.json
npm install
转载请注明来源,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 157162006@qq.com
文章标题:前端常用工具
字数:570
本文作者:沐雨云楼
发布时间:2020-06-01, 21:37:04
最后更新:2020-09-12, 21:21:47
原始链接:https://iworkh.gitee.io/blog/2020/06/01/web-tools/版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。