React-native: It looks like you have set up a native-reaction around the world.

It seems that the error is related to native-native when it is installed globally. I need it to execute correctly without seeing this error:

$ 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

The solutions posted on other forums did not work for me, I see no reason why this does not work.

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 <brentvatne@gmail.com> (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": "git@github.com:brentvatne/react-native-svgkit.git"
  },
  "scripts": {
    "start": "node /usr/local/lib/node_modules/react-native/local-cli/cli.js start"
  }
}
+4
source share
2 answers

, npm homebrew. . , , npm , node, node npm brew.

npm list -g --depth=0 # to list all your globally installed packages
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh

npm, , npm install -g <package_name>.

, , . , i.e

npm install --save-dev react-native-cli

, , .

+3

package.json

"scripts": {
   "android": "node node_modules/react-native/local-cli/cli.js run-android"
}

"scripts": {
    "android": "react-native run-android"
 }
0

All Articles