我在一些使用纯 Javascript 的项目中使用 Highcharts。现在我用 ReactJS 开始一个新项目,并在上面安装 highcharts。
npm install -g highcharts highcharts-react-official
但是当我开始使用项目时
yarn start
我收到以下错误:
Module not found: Can't resolve 'highcharts'
这是我使用命令时得到的
npm list -g --depth 0
E:\Programas\NodeJS\node-v10.16.3-win-x64
+-- axios@0.19.0
+-- create-react-app@3.1.1
+-- eslint@6.4.0
+-- highcharts@7.2.0
+-- highcharts-react-official@2.2.2
+-- my-app@0.1.0 -> E:\PUC\RelatorioCanvas\reactJs
+-- npm@6.9.0
+-- react@16.9.0
+-- react-scripts@3.1.1
+-- typescript@3.6.3
`-- yarn@1.17.3
npm ERR! peer dep missing: typescript@*, required by @typescript-eslint/eslint-plugin@1.6.0
npm ERR! peer dep missing: typescript@*, required by @typescript-eslint/parser@1.6.0
npm ERR! peer dep missing: typescript@*, required by ts-pnp@1.1.2
npm ERR! peer dep missing: typescript@*, required by @typescript-eslint/parser@1.6.0
npm ERR! peer dep missing: typescript@*, required by @typescript-eslint/typescript-estree@1.6.0
npm ERR! peer dep missing: typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta, required by tsutils@3.17.1
npm ERR! peer dep missing: typescript@*, required by @typescript-eslint/typescript-estree@1.6.0
npm ERR! peer dep missing: typescript@*, required by ts-pnp@1.1.2
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/eslint-plugin@1.13.0
npm ERR! peer dep missing: eslint@^5.0.0, required by @typescript-eslint/parser@1.13.0
我已经安装了 highcharts 和 highcharts-react-official,但问题仍然存在。
我该如何解决这个问题?