使用
初始化某个项目
npm init
yarn init
默认的安装依赖操作
npm install/link
yarn install/link
安装某个依赖,并且默认保存到package
npm install xxx —save
yarn add xxx
移除某个依赖项目
npm uninstall xxx —save
yarn remove xxx
安装某个开发时依赖项目
npm install --save-dev xxx
yarn add xxx —dev
更新某个依赖项目
npm update --save xxx
yarn upgrade xxx
安装某个全局依赖项目
npm install -g xxx
yarn global add xxx
发布/登录/登出,一系列NPM Registry操作
npm publish/login/logout
yarn publish/login/logout
运行某个命令
npm run/test
yarn run/test
网友评论