npm 基础命令
1 npm init -y
2 npm i xxx -g
3 npm i xxx -S
4 npm i xxx -D
5 npm uninstall xxx
6 npm uninstall -g xxx
7 npm i
8 npm install -g npm
2 npm 基础配置
1 npm 淘宝镜像
1 npm config get registry
2 npm config set registry https://registry.npm.taobao.org
3 安装指定版本的包: npm i xxx@2.5.16 -S / npm i xxx@2 -S
3 npx 介绍
1 会帮我们执行依赖包里的二进制文件
2 npx 会自动查找当前依赖包中的可执行文件,如果找不到,就会去 PATH 里找。如果依然找不到,就会帮你安装!
3 使用 create-react-app 创建一个 react项目
-------------------------------------------------------------------------------------
1 以前的方式
npm install -g create-react-app
create-react-app my-app
2 现在的方式
npx create-react-app my-app
-------------------------------------------------------------------------------------
4 是 npm v5.2.0 引入的一条命令