【发布时间】:2017-12-09 16:14:23
【问题描述】:
当我从我的 repo 下载一个根目录中带有 package.json 的项目时,哪个命令适合使用 npm install 或 npm install restore?
【问题讨论】:
标签: npm npm-install
当我从我的 repo 下载一个根目录中带有 package.json 的项目时,哪个命令适合使用 npm install 或 npm install restore?
【问题讨论】:
标签: npm npm-install
npm install 的行为是
不带任何参数的npm install 将在node_modules 文件夹中安装在package.json 中找到的所有包。
npm install <package_name> 将安装 package_name。在您的情况下,将下载 restore 包并将其保存在 node_modules 文件夹中。 (https://www.npmjs.com/package/restore)
【讨论】:
只需输入:
npm i
来自帮助:
>npm i -h
npm install (with no args, in package dir)
npm install [<@scope>/]<pkg>
npm install [<@scope>/]<pkg>@<tag>
npm install [<@scope>/]<pkg>@<version>
npm install [<@scope>/]<pkg>@<version range>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>
aliases: i, isntall, add
common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save]
【讨论】: