TinyMCE 安装问题记录

一、缘起

tinyMCE是一个富文本编辑器,License是LGPL-2.1,不是MIT,我想研究一下它,并且开发一些自定义插件,所以,打算从github上下载源码跑一下。

二、地址

  1. 官网地址:https://www.tiny.cloud
  2. github地址:https://github.com/tinymce/tinymce
  3. 自定义下载插件地址:https://www.tiny.cloud/get-tiny/custom-builds/ 不过好像是V4的,我测试使用的是是V5,没大用,算是为V4版的提供福利;

三、环境

  1. os:win10
  2. 包管理工具:yarn (tinyMEC不允许使用npm安装)
  3. tinyMEC版本:5.0.12

四、安装

1. 下载代码

git clone https://github.com/tinymce/tinymce.git

2.安装

在项目目录下(tinymce)使用yarn安装,再次强调:只能使用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,发现是搭建私服用的软件。难道我的yarn 的 registry 设置错了?我觉得应该不是,因为我从来没使用过私服,为了确认,我执行:

 yarn config get registry

打印结果如下:

https://registry.yarnpkg.com

没问题啊。。。
百度无果,查看源代码的时候发现了 .yarnrc文件,打开查看内容:

--install.frozen-lockfile true
workspaces-experimental true

果然有特殊设置,在yarn官网找到了解释:
install.frozen-lockfile:

If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass --frozen-lockfile flag.

有道词典翻译结果:

如果您需要可重现的依赖关系,这通常是连续集成系统的情况,那么您应该传递——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

有道词典的翻译结果是:

工作区足够稳定,可以用于大型应用程序,不应该改变常规安装的工作方式,但如果您认为它们破坏了某些东西,可以通过在Yarnrc文件中添加以下行来禁用它们

大概就是某些安装项被禁了。

5. 解决

删除这个文件,重新安装,成功!

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容