Ionic3 Highcharts-More导入错误--JsAllow Not Set
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.
我的整个项目都需要 highcharts-more,但我找不到其他方法来导入它。请帮助
使用与本文档(Typescript 部分)中所示相同的语法:https://www.npmjs.com/package/highcharts
示例是为导出模块完成的 - highcharts-more 模块应该类比导入。
我尝试像这样导入 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.
我的整个项目都需要 highcharts-more,但我找不到其他方法来导入它。请帮助
使用与本文档(Typescript 部分)中所示相同的语法:https://www.npmjs.com/package/highcharts
示例是为导出模块完成的 - highcharts-more 模块应该类比导入。