Cannot resolve NPM module which seems to have installed successfully -


i have installed few modules doing npm install --save ng2-redux redux redux-actions redux-promise. if npm list | grep "redux" get:

├── ng2-redux@3.0.5 ├─┬ redux@3.5.2 ├─┬ redux-actions@0.12.0 ├─┬ redux-promise@0.5.3 

and in package.json can find them well:

"dependencies": {   ...    "ng2-redux": "3.0.5",   "redux": "3.5.2",   "redux-actions": "0.12.0",   "redux-promise": "0.5.3",    ... } 

the problem while ng2-redux , redux both work fine:

import { applymiddleware } 'redux'; import { ngredux, select } 'ng2-redux'; 

redux-actions , redux-promise both throw cannot resolve file 'redux-actions'/'redux-promise' when trying import them, appears both in ide (webstorm 11.0.4) , in webpack:

import { createaction } 'redux-actions'; import promisemiddleware 'redux-promise'; 

the errors says:

error in ../src/.../app.component.ts (8,31): error ts2307: cannot find module 'redux-promise'. 

however...

import 'redux-actions'; import 'redux-promise'; 

...works fine.

i have tried remove node_modules folder , reinstall npm cache clear, rm -rf node_modules , npm install , doesn't fix problem.

you should have d.ts file under node_modules directory. try

npm install --save-dev @types/redux-promise 

to acquire type information of module.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -