摘要:再仔細(xì)觀察發(fā)現(xiàn)這些都是依賴的模塊。只能在下安裝,無法在系統(tǒng)安裝。下會(huì)跳過模塊,也不會(huì)安裝依賴的模塊。這其實(shí)算是的一個(gè),時(shí)報(bào),又報(bào),前后不一致,容易有誤解。這些報(bào)錯(cuò)不影響項(xiàng)目的正常運(yùn)行,因?yàn)椴恍枰?/p>
有個(gè)項(xiàng)目在mac下開發(fā),安裝包npm i,一切正常;
把這個(gè)項(xiàng)目放到linux機(jī)器上,安裝包npm i,報(bào)了一堆warning:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN [email protected] No description npm WARN [email protected] No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/abbrev): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/abbrev" -> "/root/2019/0403/node_modules/fsevents/node_modules/.abbrev.DELETE" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/ansi-regex): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/ansi-regex" -> "/root/2019/0403/node_modules/fsevents/node_modules/.ansi-regex.DELETE" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/aproba): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/aproba" -> "/root/2019/0403/node_modules/fsevents/node_modules/.aproba.DELETE" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/balanced-match): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/balanced-match" -> "/root/2019/0403/node_modules/fsevents/node_modules/.balanced-match.DELETE" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/chownr): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/chownr" -> "/root/2019/0403/node_modules/fsevents/node_modules/.chownr.DELETE" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents/node_modules/code-point-at): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename "/root/2019/0403/node_modules/fsevents/node_modules/code-point-at" -> "/root/2019/0403/node_modules/fsevents/node_modules/.code-point-at.DELETE" ...
執(zhí)行npm ls,有不少UNMET OPTIONAL DEPENDENCY的模塊,最后還報(bào)了一堆錯(cuò):
│ ├── [email protected] deduped │ ├── [email protected] deduped │ ├── [email protected] deduped │ └─┬ [email protected] │ └── [email protected] ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── [email protected] │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └─┬ UNMET DEPENDENCY [email protected] │ │ │ └─┬ UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ │ └── UNMET DEPENDENCY [email protected] │ │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ │ ├── UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ ├─┬ UNMET DEPENDENCY [email protected] │ │ │ └── UNMET DEPENDENCY [email protected] │ │ └── UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ └─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ ├── UNMET OPTIONAL DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET DEPENDENCY [email protected] │ │ ├── UNMET DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├─┬ UNMET OPTIONAL DEPENDENCY [email protected] │ │ └── UNMET DEPENDENCY [email protected] │ ├── UNMET DEPENDENCY [email protected] │ ├── UNMET DEPENDENCY [email protected] │ └── UNMET DEPENDENCY [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ └─┬ [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] deduped │ └── [email protected] └── [email protected]
npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected]
仔細(xì)觀察發(fā)現(xiàn)UNMET OPTIONAL DEPENDENCY的模塊和npm ERR是同一批模塊,也是安裝時(shí)報(bào)warning的那些模塊。
再仔細(xì)觀察發(fā)現(xiàn)這些都是fsevents依賴的模塊。
fsevents只能在macOS下安裝,無法在linux系統(tǒng)安裝。linux下會(huì)跳過fsevents模塊,也不會(huì)安裝fsevents依賴的模塊。
這其實(shí)算是npm的一個(gè)bug,npm i時(shí)報(bào)Warn,npm ls又報(bào)Err,前后不一致,容易有誤解。
目前無論用哪個(gè)版本的npm都會(huì)有這個(gè)問題,npm i --no-optional也不能解決這個(gè)問題。
這些報(bào)錯(cuò)不影響項(xiàng)目的正常運(yùn)行,因?yàn)閘inux不需要fsevents。
如果不希望看到npm Err,可以用npm i -f強(qiáng)制安裝,安裝過程沒有warn,安裝完后npm ls看下:
└─┬ [email protected] └── [email protected]
干凈了,沒有任何報(bào)錯(cuò)。
我的項(xiàng)目是chokidar這個(gè)模塊依賴了fsevents,chokidar又是browser-sync、webpack等依賴的。
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/103209.html
摘要:入門什么是是一個(gè)廣泛使用的轉(zhuǎn)碼器,可以將代碼轉(zhuǎn)為代碼,從而在現(xiàn)有環(huán)境執(zhí)行。 babel6 入門 什么是babel Babel是一個(gè)廣泛使用的轉(zhuǎn)碼器,可以將ES6代碼轉(zhuǎn)為ES5代碼,從而在現(xiàn)有環(huán)境執(zhí)行。 因?yàn)閑s6比es5的代碼更為適合編寫程序,但是因?yàn)闅v史的原因,現(xiàn)在普遍的瀏覽器并不支持es6代碼(普遍支持es5),即如果你寫es6代碼之后,在瀏覽器上運(yùn)行出錯(cuò),因?yàn)闉g覽器的javas...
摘要:分鐘搞定模塊開發(fā)創(chuàng)建組建新建目錄初始化創(chuàng)建新建測(cè)試文件大家好,我是春哥,我的電話是執(zhí)行大家好,我是春哥,我的電話是發(fā)布到去官網(wǎng)注冊(cè)一個(gè)自己的開發(fā)賬號(hào)到注冊(cè)賬號(hào)記住自己的賬號(hào),密碼,郵箱。 3分鐘搞定NPM模塊開發(fā) 創(chuàng)建組建 新建目錄 localhost:Desktop yuechunli$ pwd /Users/liyuechun/Desktop localhost:Desktop y...
摘要:原文地址石匠的是一個(gè)基于開發(fā)的一套智能合約開發(fā)框架,使用語言編寫合約。預(yù)期通過和搭建一個(gè)只能合約的開發(fā)測(cè)試環(huán)境,部署官方的測(cè)試合約進(jìn)行驗(yàn)證和后續(xù)的測(cè)試學(xué)習(xí)。 原文地址:石匠的blog truffle是一個(gè)基于Javascript開發(fā)的一套智能合約開發(fā)框架,使用Solidity語言編寫合約。truffle有一套自動(dòng)的項(xiàng)目構(gòu)建機(jī)制,集成了開發(fā),測(cè)試和部署的各個(gè)流程細(xì)節(jié),不用開發(fā)人員關(guān)注。t...
閱讀 1448·2023-04-25 19:51
閱讀 1936·2019-08-30 15:55
閱讀 1748·2019-08-30 15:44
閱讀 2707·2019-08-30 13:58
閱讀 2702·2019-08-29 16:37
閱讀 1082·2019-08-29 15:34
閱讀 4017·2019-08-29 11:05
閱讀 2633·2019-08-28 17:51