2016-09-07 2 views
0

npm install --save ng2-redux redux redux-actions redux-promise을 수행하는 몇 개의 모듈을 설치했습니다. 내가 npm list | grep "redux"을 할 경우 내가 얻을 : 성공적으로 설치 한 것으로 보이는 NPM 모듈을 해결할 수 없습니다.

├── [email protected] 
├─┬ [email protected] 
├─┬ [email protected] 
├─┬ [email protected] 

과의

package.json 나뿐만 아니라 그들을 찾을 수 있습니다

"dependencies": { 
    ... 

    "ng2-redux": "3.0.5", 
    "redux": "3.5.2", 
    "redux-actions": "0.12.0", 
    "redux-promise": "0.5.3", 

    ... 
} 

문제는 ng2-reduxredux 동안 모두 잘 작동하는지 :

import { applyMiddleware } from 'redux'; 
import { NgRedux, select } from 'ng2-redux'; 

redux-actionsredux-promise은 모두 가져 오기를 시도 할 때 Cannot resolve file 'redux-actions'/'redux-promise'을 던집니다. 전자 IDE (WebStorm 11.0.4) 및 웹팩의 :

import { createAction } from 'redux-actions'; 
import promiseMiddleware from 'redux-promise'; 

오류가 말한다 : 그러나

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

...

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

이 ... 잘 작동합니다.

이미 node_modules 폴더를 제거하고 npm cache clear, rm -rf node_modulesnpm install으로 모든 것을 다시 설치하려고 시도했지만 문제가 해결되지 않습니다.

답변

0

또한 node_modules 디렉토리 아래에 d.ts 파일이 있어야합니다. 모듈의 유형 정보를 얻으려면

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

을 시도하십시오.

관련 문제