xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.1k stars 195 forks source link

Error in npm run start #143

Closed rboixaderg closed 5 years ago

rboixaderg commented 6 years ago

Hi, I tried to install ngx-echart in my angular app, but when I run my project, shows follow error:

run npm start .... ERROR in ./node_modules/ngx-echarts/fesm5/ngx-echarts.js Module not found: Error: Can't resolve '/.../ProjectName/src/node_modules/echarts/dist/echarts.min.js' in '/.../ProjectName/node_modules/ngx-echarts/fesm5'

I follow this instructions to install the package:

https://github.com/xieziyu/ngx-echarts#Installation

package.json:

"scripts": { "ng": "ng", "start": "ng serve -o --port 9000", "build": "ng build --prod", "test": "ng test --watch --code-coverage", "lint": "ng lint", "e2e": "ng e2e" }, "dependencies": { "echarts": "^4.2.0-rc.1", "ngx-echarts": "4.0.0", }, "devDependencies": { "@angular-devkit/build-angular": "~0.5.13", "@angular/cli": "6.1.2", "@angular/compiler-cli": "6.1.1", "@angular/language-service": "6.1.1", }

and tsconfig.json

{ ..., "compilerOptions": { ..., "paths": { "echarts": ["node_modules/echarts/dist/echarts.min.js"] } } }

Thanks!

xieziyu commented 5 years ago

@rboixaderg It seems there is something wrong with your resolved path. Please double check your baseUrl of compilerOptions

rboixaderg commented 5 years ago

@rboixaderg It seems there is something wrong with your resolved path. Please double check your baseUrl of compilerOptions

Hi! In compilerOptions it is not defined baseUrl. I defined baseUrl = './' and it works!

Thanks!!