运行for (i = 1; i < n; i++) {
key = arr[i];
j = i-1;
while (j >= 0 && arr[j] > key) {
arr[j+1] = arr[j];
j = j-1;
count++;
}
arr[j+1] = key;
}
并在我的package.json中安装对等依赖项后,我无法摆脱警告。我知道警告won't actually stop my code from running,但我想尽量减少警告,以免出现警告,并且全新安装看起来不错。
这是我的package.json
yarn upgrade
终端:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"peerDependencies": {
"react": "16.0.0-alpha.6",
"react-native": "^0.44.1",
"@babel/core": "^7.0.0-0"
},
"dependencies": {
"@babel/core": "^7.0.0-0",
"@expo/samples": "2.1.1",
"expo": "^31.0.2",
"react-navigation": "^2.18.2",
"react-redux": "^6.0.0",
"redux": "^4.0.1"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0",
"install-peers": "^1.0.3",
"jest-expo": "^31.0.0",
"prop-types": "^15.0.0",
"react": "^16.6.3",
"react-native": "^0.57.1"
},
"private": true
}
答案 0 :(得分:0)
例如要消除此警告:
react-native@0.57.7”具有不正确的对等项依赖关系“ react@16.6.1”
尝试命令
npm install react@16.6.1
因为react-native依赖于react的特定版本。