n ../../node_modules/@storybook/channels/dist/index.d.ts:25:9 - error TS1086: An accessor cannot ...

如题,在开发angular插件的时候发现报了如题错误

n ../../node_modules/@storybook/channels/dist/index.d.ts:25:9 - error TS1086: An accessor cannot be declared in an ambient context.
原因

因为angular版本不匹配。 插件库用的typescript版本为3.8.3,在使用项目中typescript版本为3.5.3所以导致了出现如上的错误。

解决办法

尝试在tsconfig.json中配置 "skipLibCheck" :true, 即可解决问题

{
  "compilerOptions": {
    "baseUrl": "src",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",

    **"skipLibCheck": true,**

    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
}

你可能感兴趣的:(n ../../node_modules/@storybook/channels/dist/index.d.ts:25:9 - error TS1086: An accessor cannot ...)