marcj / angular2-localstorage

Angular 2+ decorator to save and restore variables/class properties to HTML5 LocalStorage automatically.
303 stars 107 forks source link

angular2-localstorage/index.js implicitly has an 'any' type #84

Open rj93 opened 7 years ago

rj93 commented 7 years ago

I am using Angular 4 (not sure if its compatiable?), and I'm trying to use local storage. I have angular2-localstorage installed at /node_modules/angular2-localstorage but I am unable to start the application. The full error I get is:

> angular-quickstart@1.0.0 prestart C:\xampp\htdocs\reddit-search
> npm run build

> angular-quickstart@1.0.0 build C:\xampp\htdocs\reddit-search
> tsc -p src/

src/app/app.module.ts(7,53): error TS7016: Could not find a declaration file for module 'angular2-localstorage'. 'C:/xampp/htdocs/reddit-search/node_modules/angular2-localstorage/index.js' implicitly has an 'any' type.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart@1.0.0 build: `tsc -p src/`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 build script 'tsc -p src/'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc -p src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Richard\AppData\Roaming\npm-cache\_logs\2017-05-08T09_58_24_195Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular-quickstart@1.0.0 prestart: `npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 prestart script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Richard\AppData\Roaming\npm-cache\_logs\2017-05-08T09_58_24_231Z-debug.log
DanielKucal commented 7 years ago

ngx-store is compatible with Angular v4 and AoT compiler. Give it a try :)