Tips
有些包可能被墙或者速度很慢
可以使用淘宝镜像试试
npm install cnpm -g --registry=https://registry.npm.taobao.org
安装命令
- -P, --save-prod: Package will appear in your dependencies. This is the default unless -D or -O are present.
- -D, --save-dev: Package will appear in your devDependencies.
- -O, --save-optional: Package will appear in your optionalDependencies.
- --no-save: Prevents saving to dependencies.
- When using any of the above options to save dependencies to your package.json, there are two additional, optional flags:
- -E, --save-exact: Saved dependencies will be configured with an exact version rather than using npm’s default semver range operator.
- -B, --save-bundle: Saved dependencies will also be added to your bundleDependencies list.
-P(生产环境)
如iView框架,部署后也需要依赖
-D(开发环境)
如loader,babel这类只有开发的时候需要的包
参考:
npm-install
网友评论