Shorhand用于从同一软件包中安装多个npm模块

Lek*_*ath 5 npm npm-install

从同一软件包安装多个npm模块有什么捷径吗?

我的意思是,而不是:

npm i @angular/common @angular/compiler @angular/core @angu lar/forms @angular/http @angular/platform-browser @angular/platform-browser-dynamic @angular/router @angular/router -deprecated -S

我可以做类似的事情吗?

npm i @angular/{common, compiler, core, forms, platform-browser, platform-browser-dynamic, router, router-deprecated} -S

Lek*_*ath 5

我很接近问题的解决方案。我可以这样删除花括号中的多余空格字符,如下所示:

npm i @angular/{common,compiler,core,forms,platform-browser,platform-browser-dynamic,router,router-deprecated} -S

  • 出于记录目的,花括号语法是Shell的功能,因此仅在Mac和Linux环境下有效。Aka在Windows上无法与Powershell一起使用。 (4认同)