我想我对npm如何管理依赖关系感到困惑.我看到了这个:
npm list react-native [email protected] /Users/me/workspace/project └── UNMET PEER DEPENDENCY [email protected] npm ERR! peer dep missing: react-native@^0.13.2,required by [email protected] npm ERR! code 1
所以我试试……但我明白了:
npm install [email protected] .... [email protected] /Users/me/workspace/project └─┬ UNMET PEER DEPENDENCY [email protected] └── [email protected] (git+https://github.com/facebook/react.git#b4e74e38e43ac53af8acd62c78c9213be0194245) npm WARN EPEERINVALID [email protected] requires a peer of react-native@^0.13.2 but none was installed. npm ERR! code 1
我的package.json:
{ "name": "project","version": "0.0.1","private": true,"scripts": { "start": "react-native start" },"dependencies": { "apsl-react-native-button": "^2.1.0","base-64": "^0.1.0","es6-react-mixins": "^0.2.1","fifo": "^2.3.0","money-math": "^2.2.0","react-native": "^0.15.0","react-native-dropdown-android": "0.0.4","react-native-lightBox": "^0.5.0","react-native-mail": "^0.2.4","react-native-router-flux": "^0.3.4","react-native-simpledialog-android": "^1.0.2","react-native-swiper": "^1.3.0","superagent": "^1.4.0","tcomb-form-native": "^0.3.0","utf8": "^2.1.1","react-native-facebook-login": "^1.0.0" } }
尝试“npm install”命令的“–save”参数,如:
npm install [email protected] --save