2017-07-17 79 views
2

嘗試安裝react-transition-group,但出現以下錯誤無法安裝反應過渡組

npm install [email protected] --save 


npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements! 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^0.14.9 || >=15.3.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^15.6.1 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.12.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^0.14.0 || ^15.0.0-0 || ^16.0.0-0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^15 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^15 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^0.14.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^15.0.0 

在packages.json目前的依賴性

"dependencies": { 
    "accounting": "0.4.1", 
    "babel-runtime": "^6.20.0", 
    "css-loader": "0.28.2", 
    "history": "4.6.1", 
    "immutable": "3.8.1", 
    "jsonapi-serializer": "3.5.3", 
    "numeral": "2.0.6", 
    "prop-types": "15.5.10", 
    "react": "^15.3.0", 
    "react-bootstrap": "0.31.0", 
    "react-dom": "^15.4.1", 
    "react-fontawesome": "1.6.1", 
    "react-redux": "5.0.5", 
    "react-router": "4.1.1", 
    "react-router-dom": "4.1.1", 
    "redux": "3.6.0", 
    "sprintf-js": "1.1.1", 
    "style-loader": "0.18.1", 
    "superagent": "3.5.2", 
    "superagent-no-cache": "0.1.1", 
    "zpad": "0.5.0" 
    }, 

回答

1
  1. 更新NPM npm install npm -g
  2. 已清除緩存:npm cache clear
  3. 已刪除node_modules rm -rf node_modules
  4. 重新安裝node_modules,npm install
+1

更新npm就足夠了。謝謝! –

+0

如果您使用的是最新版本的npm,那麼您不能執行'npm cache clear'''。從npm @ 5開始,npm緩存可以從腐敗問題中自行修復,並且從緩存中提取的數據保證有效。如果您想確保一切都一致,請使用'npm cache verify'。 –