tui-editor安装报错处理方法
项目中yarn或npm install时,tui-editor(富文本编辑器插件)安装报错。
显示
warning tui-editor > highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latesterror An unexpected error occurred: "/sohee-lee7/Squire: read ECONNRESET".info If you think this is a bug, please open a bug report with the information provided in "E:\\sacm\\sintels-web\\yarn-error.log".info Visit /en/docs/cli/install for documentation about this command.Error: Command failed.Exit code: 128Command: gitArguments: ls-remote --tags --heads /nhn/raphael.gitDirectory: E:\sacm\sintels-webOutput:fatal: unable to access '/nhn/raphael.git/': OpenSSL SSL_read: Connection was reset, errno 10054at ProcessTermError.ExtendableBuiltin (D:\Program Files\nodejs\node_global\node_modules\yarn\lib\cli.js:721:66)at ProcessTermError.MessageError (D:\Program Files\nodejs\node_global\node_modules\yarn\lib\cli.js:750:123)at new ProcessTermError (D:\Program Files\nodejs\node_global\node_modules\yarn\lib\cli.js:790:113)at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_global\node_modules\yarn\lib\cli.js:25787:17)at ChildProcess.emit (node:events:513:28)at maybeClose (node:internal/child_process:1100:16)at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
解决方案
因为vue 放弃“tui-editor“: “1.3.3“,已经更名为toast-ui/editor,需要在package.json中将“tui-editor“: “1.3.3“ 修改成"@toast-ui/editor": “^3.1.3”,重新运行yarn 即可;
同时
进入\src\components\MarkdownEditor\index.vue文件,修改成如下
import 'codemirror/lib/codemirror.css' // codemirrorimport '@toast-ui/editor/dist/toastui-editor.css'import Editor from '@toast-ui/editor'import defaultOptions from './default-options'/*tui-editor 1.33 已升级 @toast-ui/editorimport 'codemirror/lib/codemirror.css' // codemirrorimport 'tui-editor/dist/tui-editor.css' // editor uiimport 'tui-editor/dist/tui-editor-contents.css' // editor contentimport Editor from 'tui-editor'import defaultOptions from './default-options'*/