2017-07-17 45 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'。 –