2016-08-07 268 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 
相關問題