簡體   English   中英

Ionic3 Highcharts-更多導入錯誤--JsAllow未設置

[英]Ionic3 Highcharts-More import Error --JsAllow Not Set

我嘗試導入Highcharts-更像這樣:

import Highmore from '../../node_modules/highcharts/highcharts-more';

然后即時通訊收到以下錯誤:

Module '../../node_modules/highcharts/highcharts-more' was resolved to 'C:/Users/.../node_modules/highcharts/highcharts-more.js', but '--allowJs' is not set.

所以我進入tsconfig.json並將allowJs添加到我的設置中:

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

之后,我收到一個新的錯誤:

Cannot write file 'C:/Users/../node_modules/highcharts/highcharts-more.js' because it would overwrite input file.

我在整個項目中需要更多圖表,我找不到其他導入方法。 請幫忙

使用與本文檔(“ 打字稿”部分)所示相同的語法: https : //www.npmjs.com/package/highcharts

該示例已針對導出模塊完成-應該以類似方式導入highcharts-more模塊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM