【发布时间】:2017-12-26 12:37:00
【问题描述】:
我正在将我的项目升级到 angular5。
在我的 package.json 中:
"dependencies": {
"highcharts-export-csv": "git+https://github.com/highcharts/export-csv.git"
}
"devDependencies": {
"@angular/cli": "1.6.2",
"@angular/compiler-cli": "~5.1.2",
"typescript": "^2.6.2"
}
它有效,但我收到警告:
@angular/compiler-cli@5.1.2 requires typescript@'>=2.4.2 <2.6.0' but 2.6.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.4.2 <2.6.0'
To disable this warning run "ng set warnings.typescriptMismatch=false".
所以,我将我的 typescript 版本更改为 2.5.3,但现在我有编译错误,当 cli 和 typescript 版本不匹配时我没有。
这是一个很长的错误,但如果我没有错,这里是关键:
ERROR in ./src/app/myCsv/myCsv.module.ts
Module not found: Error: Can't resolve 'highcharts-export-csv' in '/myRoute/myCsv'
resolve 'highcharts-export-csv' in '/myRoute/src/app/myCsv'
Parsed request is a module
using description file: /myRoute/package.json (relative path: ./src/app/myCsv)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /myRoute/package.json (relative path: ./src/app/myCsv)
resolve as module
【问题讨论】:
-
我不明白如何安装 2.6.2 typescript 版本,但没有显示警告。我可以忽略它吗?
标签: typescript highcharts angular5