2017-11-14 3 views
0

내가 타이프로 React.js 사용하고 난이 오류 봉착 :React.js 타이프의 sweetalert 에러

node_modules\@types\sweetalert\index.d.ts 
error TS2451: Cannot redeclare block-scoped variable 'sweetAlert'. 

종속성

"dependencies": { 
    "react": "^16.1.0", 
    "react-dom": "^16.1.0", 
    "react-router-dom": "^4.2.2", 
    "react-scripts-ts": "2.8.0", 
    "sweetalert": "^2.0.8" 
    }, 
    "devDependencies": { 
    "@types/jest": "^21.1.6", 
    "@types/node": "^8.0.51", 
    "@types/react": "^16.0.22", 
    "@types/react-dom": "^16.0.3", 
    "@types/react-router-dom": "^4.2.1", 
    "@types/sweetalert": "^1.1.28" 
    } 

답변

0

Cannot redeclare block-scoped variable 'sweetAlert'.

sweetAlert는 타이프로 작성을 더 이상 @types/sweetAlert이 필요하지 않습니다.

수정

npm uninstall @types/sweetAlert 

이익