npm i 时出现如下问题

网上有2种解决办法 :①② (反正第①种没解决我的问题,我用的第②种)

①第一种

第一步:运行下面这行代码 

git config --global http.sslverify "false"
或
git config --global http.sslverify false

第二步:再执行npm install 就可以了

npm install

第三步:如果你第二部已经可以了,就不用看这一步;如果你运行npm i 之后继续报上边那个错误,运行下面这行代码

git config --global url."https://".insteadOf git://

②第二种

(解决了我的问题!!!呜呜呜 太难了   这个问题搞了半天 终于解决了)

第一步:先删除package.json的 tui-editor配置项,然后运行npm i 或者 yarn install会正常编译。

第二步:再手动安装 tui-editor

 npm install --save tui-editor

第三步:如果你第二部已经可以了,就不用看这一步;如果第二步安装不上,那就运行下边这行代码(tui-editor可能会安装不成功,原因是原先的tui-editor换了个名称,现在已经更名为@toast-ui/editor因此安装不了,从而报错)

npm install --save @toast-ui/editor

  1. 文件更名:进入\src\components\MarkdownEditor\index.vue文件,将他的所有import删除换成下面四行  
    import 'codemirror/lib/codemirror.css'
    import '@toast-ui/editor/dist/toastui-editor.css'
    import Editor from '@toast-ui/editor'
    import defaultOptions from './default-options'
  2. 方法更名

    1)把该页面(还是上面1中的文件)的getValuesetValue分别换成getMarkdownsetMarkdown

    2)把页面中的所有tui-editor全部替换为@toast-ui/editor

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐