一愧薛、緣起
tinyMCE是一個富文本編輯器,License是LGPL-2.1衫画,不是MIT毫炉,我想研究一下它,并且開發(fā)一些自定義插件削罩,所以瞄勾,打算從github上下載源碼跑一下。
二弥激、地址
- 官網(wǎng)地址:https://www.tiny.cloud
- github地址:https://github.com/tinymce/tinymce
- 自定義下載插件地址:https://www.tiny.cloud/get-tiny/custom-builds/ 不過好像是V4的进陡,我測試使用的是是V5,沒大用微服,算是為V4版的提供福利趾疚;
三、環(huán)境
- os:win10
- 包管理工具:yarn (tinyMEC不允許使用npm安裝)
- tinyMEC版本:5.0.12
四、安裝
1. 下載代碼
git clone https://github.com/tinymce/tinymce.git
2.安裝
在項目目錄下(tinymce)使用yarn安裝糙麦,再次強調(diào):只能使用yarn
辛孵,不能使用npm
yarn
3. 報錯信息摘要
控制臺打印信息:
An unexpected error occurred: "http://nexus:8081/repository/npm-group/@ephox/wrap-promise-polyfill/-/wrap-promise-polyfill-2.2.0.tgz: getaddrinfo ENOTFOUND nexus nexus:8081
錯誤日志文件:
Trace:
Error: getaddrinfo ENOTFOUND nexus nexus:8081
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
4.分析原因
我試著訪問了一下控制臺提示的鏈接,無法訪問赡磅,查了一下 nexus
魄缚,發(fā)現(xiàn)是搭建私服用的軟件。難道我的yarn 的 registry 設(shè)置錯了仆邓?我覺得應(yīng)該不是鲜滩,因為我從來沒使用過私服,為了確認节值,我執(zhí)行:
yarn config get registry
打印結(jié)果如下:
https://registry.yarnpkg.com
沒問題啊徙硅。。搞疗。
百度無果嗓蘑,查看源代碼的時候發(fā)現(xiàn)了 .yarnrc
文件,打開查看內(nèi)容:
--install.frozen-lockfile true
workspaces-experimental true
果然有特殊設(shè)置匿乃,在yarn官網(wǎng)找到了解釋:
install.frozen-lockfile:
If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass --frozen-lockfile flag.
有道詞典翻譯結(jié)果:
如果您需要可重現(xiàn)的依賴關(guān)系桩皿,這通常是連續(xù)集成系統(tǒng)的情況,那么您應(yīng)該傳遞——frozen-lockfile標志
workspaces-experimental:
Workspaces are stable enough to be used in large-scale applications and shouldn’t change anything from the way the regular installs work, but if you think they’re breaking something, you can disable them by adding the following line into your Yarnrc file:
workspaces-experimental false
有道詞典的翻譯結(jié)果是:
工作區(qū)足夠穩(wěn)定幢炸,可以用于大型應(yīng)用程序泄隔,不應(yīng)該改變常規(guī)安裝的工作方式,但如果您認為它們破壞了某些東西宛徊,可以通過在Yarnrc文件中添加以下行來禁用它們
大概就是某些安裝項被禁了佛嬉。
5. 解決
刪除這個文件,重新安裝闸天,成功暖呕!