SortableJS/ngx-sortablejs

error TS2307: Cannot find module 'sortablejs'.

MateusKernDigibyte opened this issue · 2 comments

Hello, I installed version 10.0.0 of ngx-sortablejs and had the following errors when I ran ng serve in my project in angular:

C:\Users\Desenv5\Desktop\Digi Byte\Sistemas Contábeis FRONT v2\app>ng serve

chunk {main} main.js, main.js.map (main) 2.07 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 713 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 14.3 MB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 6.54 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 339 kB [initial] [rendered]
Date: 2020-12-09T13:43:17.779Z - Hash: 5fde6fba62f81ca02036 - Time: 21190ms

ERROR in node_modules/ngx-sortablejs/lib/sortablejs.directive.d.ts:2:25 - error TS2307: Cannot find module 'sortablejs'.       

2 import { Options } from 'sortablejs';
                          ~~~~~~~~~~~~
node_modules/ngx-sortablejs/lib/sortablejs.module.d.ts:2:25 - error TS2307: Cannot find module 'sortablejs'.

2 import { Options } from 'sortablejs';
                          ~~~~~~~~~~~~
node_modules/ngx-sortablejs/lib/globals.d.ts:2:25 - error TS2307: Cannot find module 'sortablejs'.

2 import { Options } from 'sortablejs';
                          ~~~~~~~~~~~~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

For some reason he isn't finding Options, and I can't understand why.
I already installed version 9.0.0 and also couldn't find Options.

Follow my package.json:

{
    "name": "metronic-angular",
    "version": "7.0.6",
    "description": "Packages used by Angular",
    "scripts": {
        "ng": "ng",
        "start": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng serve",
        "build-prod-old": "ng build --prod",
        "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --configuration=production",
        "build-desenv": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e",
        "bundle-report": "webpack-bundle-analyzer dist/stats.json",
        "rtl": "webpack"
    },
    "private": true,
    "dependencies": {
        "@angular/animations": "9.1.3",
        "@angular/cdk": "9.2.1",
        "@angular/common": "9.1.3",
        "@angular/compiler": "9.1.3",
        "@angular/core": "9.1.3",
        "@angular/forms": "9.1.3",
        "@angular/platform-browser": "9.1.3",
        "@angular/platform-browser-dynamic": "9.1.3",
        "@angular/platform-server": "9.1.3",
        "@angular/router": "9.1.3",
        "@auth0/angular-jwt": "^5.0.1",
        "@brunoc/ngx-viacep": "^2.1.2",
        "@fortawesome/fontawesome-free": "5.13.0",
        "@ng-bootstrap/ng-bootstrap": "6.1.0",
        "@ng-select/ng-select": "^4.0.4",
        "@ngrx/effects": "9.1.0",
        "@ngrx/entity": "9.1.0",
        "@ngrx/router-store": "9.1.0",
        "@ngrx/store": "9.1.0",
        "@ngrx/store-devtools": "9.1.0",
        "@ngx-loading-bar/core": "4.2.0",
        "@ngx-translate/core": "12.1.2",
        "@types/lodash": "4.14.150",
        "angular-in-memory-web-api": "0.10.0",
        "angular2-datatable": "^0.6.0",
        "apexcharts": "^3.19.0",
        "bootstrap": "4.5.0",
        "chart.js": "2.9.3",
        "chartist": "0.11.4",
        "classlist.js": "1.1.20150312",
        "clipboard": "2.0.6",
        "core-js": "3.6.5",
        "crypto-js": "^4.0.0",
        "file-saver": "^2.0.2",
        "hammerjs": "2.0.8",
        "highlight.js": "^9.17.1",
        "lodash": "^4.17.20",
        "material-design-icons": "3.0.1",
        "moment": "2.24.0",
        "ng-apexcharts": "^1.2.3",
        "ng-inline-svg": "10.0.0",
        "ngrx-store-freeze": "0.2.4",
        "ngx-bootstrap": "^5.6.1",
        "ngx-clipboard": "13.0.0",
        "ngx-currency": "^2.3.3",
        "ngx-daterangepicker-material": "2.2.0",
        "ngx-dropzone": "^2.2.2",
        "ngx-highlightjs": "3.0.3",
        "ngx-mask": "^9.1.2",
        "ngx-perfect-scrollbar": "9.0.0",
        "ngx-permissions": "7.0.3",
        "ngx-phone-mask-br": "^1.0.3",
        "ngx-pipes": "^2.7.5",
        "ngx-sortablejs": "^10.0.0",
        "object-path": "^0.11.5",
        "popper.js": "^1.16.1",
        "rxjs": "6.5.5",
        "rxjs-compat": "^6.6.0",
        "socicon": "3.0.5",
        "toastr": "^2.1.4",
        "tooltip.js": "^1.3.3",
        "tslib": "1.11.1",
        "web-animations-js": "2.3.2",
        "zone.js": "0.10.3"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "0.901.3",
        "@angular/cli": "^9.1.11",
        "@angular/compiler-cli": "9.1.3",
        "@angular/language-service": "9.1.3",
        "@angular/material": "9.2.1",
        "@angular/material-moment-adapter": "9.2.1",
        "@ngrx/schematics": "9.1.0",
        "@types/chartist": "0.9.47",
        "@types/jasmine": "3.5.0",
        "@types/jasminewd2": "2.0.3",
        "@types/node": "12.11.1",
        "@types/object-path": "0.11.0",
        "codelyzer": "5.2.2",
        "css-loader": "^3.4.2",
        "jasmine-core": "3.5.0",
        "jasmine-spec-reporter": "4.2.1",
        "karma": "^5.2.3",
        "karma-chrome-launcher": "3.1.0",
        "karma-coverage-istanbul-reporter": "2.1.0",
        "karma-jasmine": "2.0.1",
        "karma-jasmine-html-reporter": "1.4.2",
        "node-sass": "4.13.1",
        "protractor": "^7.0.0",
        "ts-node": "8.3.0",
        "tslint": "6.0.0",
        "typescript": "3.7.5",
        "webpack-bundle-analyzer": "3.6.1",
        "webpack-cli": "3.3.11",
        "webpack-messages": "2.0.4",
        "webpack-rtl-plugin": "2.0.0"
    },
    "browser": {
        "crypto": false
    }
}

Do you have any idea what this error is?

The same happens for me...

@ciglesiasweb I solve the problem follow the steps in Installation:

npm i -S ngx-sortablejs sortablejs
npm i -D @types/sortablejs

Because before I had just performed the installation that the NPM page indicated