2016-06-09 83 views
1

本声明Windows机器上多包npm安装的正确语法是什么?

npm install --save @angular2-material/{core,button,card}

(从here拍摄)产生

At line:1 char:44 
+ npm install --save @angular2-material/{core,button,card} 
+           ~ 
Missing argument in parameter list. 
    + CategoryInfo   : ParserError: (:) [], ParentContainsErrorRecordException 
    + FullyQualifiedErrorId : MissingArgument 

在Windows PowerShell中它产生

npm ERR! addLocal Could not install D:\VST\ngMaterial1\@angular2-material\{core,button,card} 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "@angular2-material/{core,button,card}" 
npm ERR! node v5.10.1 
npm ERR! npm v3.8.3 
npm ERR! path D:\VST\ngMaterial1\@angular2-material\{core,button,card} 
npm ERR! code ENOENT 
npm ERR! errno -4058 
npm ERR! syscall open 

npm ERR! enoent ENOENT: no such file or directory, open 'D:\VST\ngMaterial1\@angular2-material\{core,button,card}' 
npm ERR! enoent ENOENT: no such file or directory, open 'D:\VST\ngMaterial1\@angular2-material\{core,button,card}' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  D:\VST\ngMaterial1\npm-debug.log 

在Windows 控制台 (并且在PowerShell--save参数用引号括起)。

在Windows机器上多包npm安装的正确语法是什么?

回答

1

正确的命令是npm i lodash hapi thinky when。你可以阅读更多NPM提示here

+1

看来这样的安装说明是打算被解释(展开)而不是仅仅逐字地应用。 – CalvinDale

1

以下命令:

npm install --save @angular2-material/{core,button,card} 

是bash所扩大到:

npm install --save @angular2-material/core @angular2-material/button @angular2-material/card 

在Windows上,你可以使用MingW Bash实现完全相同的功能或扩大该命令手动。

-1

{package1, package2...}技巧特定于bash。这在powershell或cmd中不起作用。要在Windows上运行这个工作,请打开一个新的git bash(或等效的)终端并运行该命令,它应该可以工作。