Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the proper syntax for multi-package npm installs on Windows machines?

This statement

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

(taken from here) yields

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

in Windows PowerShell and it yields

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

in Windows Console (and also in PowerShell when the --save argument is wrapped in quotes).

What is the proper syntax for multi-package npm installs on Windows machines?

like image 351
CalvinDale Avatar asked Jan 27 '26 07:01

CalvinDale


2 Answers

The following command:

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

Is expanded by bash to:

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

On Windows, you can use MingW Bash to achieve the exact same functionality or expand the command manually.

like image 70
sergiogarciadev Avatar answered Jan 28 '26 19:01

sergiogarciadev


The {package1, package2...} trick is specific to bash. This does not work in PowerShell or cmd. To get this working on Windows open a new Git Bash (or equivalent) terminal and run the command and it should work.

like image 45
mithun_daa Avatar answered Jan 28 '26 21:01

mithun_daa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!