在全局安裝時,似乎存在react-native的錯誤。我需要它沒有看到這個錯誤正確執行:React-native:看起來像是在全球安裝了react-native
$ react-native run-ios
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
解決方案在其他論壇貼我沒有工作,我不明白爲什麼這是行不通的。
package.json
:
{
"name": "react-native-svgkit",
"version": "0.2.2",
"main": "Svg.js",
"description": "A <Svg /> element for react-native that renders Svg images using SVGKit",
"author": "Brent Vatne <[email protected]> (https://github.com/brentvatne)",
"peerDependencies": {
"react": "15.1.0",
"react-native": ">=0.4.4"
},
"devDependencies": {
"react-native": ">=0.4.4",
"react-native-cli": "^0.1.10"
},
"dependencies": {
"d3": "^3.5.5",
"jsdom-jscore": "^0.1.0",
"react-native-svg": "^2.2.0"
},
"repository": {
"type": "git",
"url": "[email protected]:brentvatne/react-native-svgkit.git"
},
"scripts": {
"start": "node /usr/local/lib/node_modules/react-native/local-cli/cli.js start"
}
}
是否運行通過NPM這個命令? –
是的,它位於標準的全局位置'/ usr/local/bin/react-native' –
你能分享你的package.json文件嗎? –