question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'ng-apexcharts'

See original GitHub issue

HI i first of all thanks for the angular wrapper. Great work. I thought of using the library for one of my projects and i get the following error when i try to import the module into the application as follows.

import { AppComponent } from './app.component';
import { NgApexchartsModule } from 'ng-apexcharts';

ERROR in src/app/app.module.ts(14,36): error TS2307: Cannot find module ‘ng-apexcharts’

image

I have followed the same steps as mentioned in the the docs and it doesnt seem to be working. Can you please look into the issue and let me know if there are any workarounds/Solution for this. Thanks.

My working environment:

Package JSON:

"@angular/animations": "~7.0.0",
    "@angular/common": "~7.0.0",
    "@angular/compiler": "~7.0.0",
    "@angular/core": "~7.0.0",
    "@angular/forms": "~7.0.0",
    "@angular/http": "~7.0.0",
    "@angular/platform-browser": "~7.0.0",
    "@angular/platform-browser-dynamic": "~7.0.0",
    "@angular/router": "~7.0.0",
    "apexcharts": "^3.6.4",
    "core-js": "^2.5.4",
    "ng-apexcharts": "^1.0.0",
    "rxjs": "~6.3.3",
    "zone.js": "~0.8.26"

Angular CLi

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "try": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "styleext": "scss"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/try",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": [
              "node_modules/apexcharts/dist/apexcharts.min.js"
            ]
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "try:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "try:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "try:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "src/styles.scss"
            ],
            "scripts": [
              "node_modules/apexcharts/dist/apexcharts.min.js"
            ],
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "try-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "try:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "try:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "try"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
junedchhipacommented, Mar 25, 2019

Released version 1.0.1 Please try

npm install -S apexcharts ng-apexcharts@latest
0reactions
firugescommented, Aug 5, 2022

Had the same issue. Solution was to strictly follow the installation steps on the repository main page. The official installation guide on the apexcharts.com page doesn’t include these details:

1. npm install apexcharts ng-apexcharts --save

2. Open angular.json and under scripts add: [... See repository main page ...]

3. (Re)start npm server

4. Add ng-apexcharts-module to imports: [...]

Only step one work for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng-apexcharts - npm
Start using ng-apexcharts in your project by running `npm i ng-apexcharts`. There are 22 other projects in the npm registry using ng-apexcharts.
Read more >
Cannot find module 'ng-apexcharts' in spec.ts - Stack Overflow
I'm currently trying to do unit tests on my Angular app using ng-apexcharts lib. Unfortunately, when I run my tests with Jest, ...
Read more >
How to create Angular charts using ApexCharts
1. Install using npm npm install apexcharts ng-apexcharts --save · 2. Open angular.json and under scripts add: "scripts": [ "node_modules/apexcharts/dist/ ...
Read more >
ng-apexcharts - npm Package Health Analysis - Snyk
We found a way for you to contribute to the project! Looks like ng-apexcharts is missing a security policy. You can connect your...
Read more >
ng-apexcharts angular 8 - Code Examples & Solutions For ...
npm install apexcharts ng-apexcharts --save.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found