Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install multiple package names

What does it do when I run this command:

npm install --save-dev package1 package2 

It is definitely not installing multiple packages, but it looks to be essential. (For example https://www.browsersync.io/docs/gulp)

For me it throws following ERRs:

C:\1HLAVNI\Lukas\Webdesign\lukasradek>npm install --save-dev gulp-babel gulp-add-src    > [email protected] install C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\bufferutil  > node-gyp rebuild      C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )  gyp ERR! configure error  gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.  gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)  gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11  gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)  gyp ERR! System Windows_NT 10.0.10586  gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"  gyp ERR! cwd C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\bufferutil  gyp ERR! node -v v6.3.1  gyp ERR! node-gyp -v v3.3.1  gyp ERR! not ok  npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`  npm WARN install:[email protected] Exit status 1    > [email protected] install C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\utf-8-validate  > node-gyp rebuild      C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )  gyp ERR! configure error  gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.  gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)  gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11  gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)  gyp ERR! System Windows_NT 10.0.10586  gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"  gyp ERR! cwd C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\utf-8-validate  gyp ERR! node -v v6.3.1  gyp ERR! node-gyp -v v3.3.1  gyp ERR! not ok  npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`  npm WARN install:[email protected] Exit status 1  [email protected] C:\1HLAVNI\Lukas\Webdesign\lukasradek  +-- [email protected]  | +-- [email protected]  | | `-- [email protected]  | +-- [email protected]  | | `-- [email protected]  | `-- [email protected]  |   +-- [email protected]  |   `-- [email protected]  |     `-- [email protected]  `-- [email protected]    +-- [email protected]    | +-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | | +-- [email protected]    | | | `-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | | +-- [email protected]    | | +-- [email protected]    | | +-- [email protected]    | | +-- [email protected]    | | `-- [email protected]    | |   `-- [email protected]    | +-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | | +-- [email protected]    | | +-- [email protected]    | | | `-- [email protected]    | | |   `-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | | +-- [email protected]    | | `-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | +-- [email protected]    | `-- [email protected]    `-- [email protected]    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:  npm WARN notsup Not compatible with your operating system or architecture: [email protected]  npm WARN [email protected] No repository field.
like image 688
Lukáš Řádek Avatar asked Aug 07 '16 19:08

Lukáš Řádek


People also ask

How do I install multiple npm packages in one command?

To install multiple packages, we need to use the npm install followed by the multiple package names separated by the spaces package1 package2 . This above command installs three packages, which are express, cors and body-parser. You can also checkout how to install the specific version of an npm package.

How do I update multiple npm packages?

If you still want to update everything to the latest version, you can use the tool npm-update-all . It's as easy as running this command in your project folder. As you can see, npm-update-all will update all your packages to the latest version.

How many ways can you install npm packages?

The npm install command allows the user to install a package. There are two types of installation: local install. global install.

Does npm install install all packages?

By default, npm install will install all modules listed as dependencies in package. json .


2 Answers

Save as dependencies:

npm i package1 package2 

Save as dev-dependencies:

npm i -D package1 package2  npm i --save-dev package1 package2 
like image 78
Carlos Perez Avatar answered Oct 05 '22 23:10

Carlos Perez


It is definitely not installing multiple packages

Why? You're installing package1 and package2 and marking them as devDependencies with --save-dev.

As stated in the documentation, you may combine multiple arguments, and even multiple types of arguments. In your case, you're combining 2 package names published on the registry.

like image 32
HiDeo Avatar answered Oct 05 '22 22:10

HiDeo