2016-08-07 232 views
0

当我运行这个命令它能做什么:NPM安装多个软件包名

npm install --save-dev package1 package2 

这绝对不是安装多个包,但它看起来是至关重要的。 (例如https://www.browsersync.io/docs/gulp

对我来说,它抛出以下犯错:

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.

+0

所以你指出* “这绝对不是安装多个包” * - 这是什么你的情况呢?运行该命令后,控制台的输出是什么? – Steve

+0

它提供了一个很长的错误列表,它不会产生,而单独安装包。查看更新的帖子。 –

+0

你的意思是错误吗?这些软件包需要Python,安装正确版本的Python并重新安装,你不会再看到这些错误。 – Nhan

回答

2

这绝对不是安装多个软件包

为什么?您正在安装程序包1程序包2并将它们标记为devDependencies--save-dev

如在the documentation中所述,您可以组合多个参数,甚至多个类型的参数。在你的情况下,你要合并在注册表上发布的2个包名。

+0

Stangely对我来说,它会引发多个错误,甚至不会围绕已安装的软件包进行循环。如果我尝试逐一安装它,一切都会好的。看到我更新的帖子。 –

11

另存为依赖关系:

npm i -S package1 package2 

另存为DEV-依赖关系:

npm i -D package1 package2 
相关问题