Nativebase: Installing nativebase breaks clean install react-native project

Created on 10 Jun 2017  ยท  4Comments  ยท  Source: GeekyAnts/NativeBase

react-native-cli: 2.0.1
react-native: 0.45.1
node version: v8.0.0
OS: OSX 10.12.5

Steps to reproduce:

  1. Follow setup instructions at : https://docs.nativebase.io/docs/GetStarted.html
  2. After react-native init, validate with react-native run-ios, verify the welcome app is viewable
  3. Run : npm install native-base --save, no errors observed
  4. Run react-native link results in following error:
    Command link unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
  5. Run react-native run-ios results in following error
    jrempel@Jeremys-MBP ~/AwesomeNativeBase> react-native run-ios
    Command run-ios unrecognized. Make sure that you have run npm install and that you are inside a react-native project.

Output from: npm install native-base --save
jrempel@Jeremys-MBP ~/AwesomeNativeBase> npm install native-base --save
npm WARN gentlyRm not removing /Users/jrempel/AwesomeNativeBase/node_modules/.bin/jest as it wasn't installed by /Users/jrempel/AwesomeNativeBase/node_modules/jest-cli

[email protected] postinstall /Users/jrempel/AwesomeNativeBase/node_modules/native-base
node addEjectScript.js

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ NativeBase 2.0 has been succesfully installed! โ”‚
โ”‚ Run node node_modules/native-base/ejectTheme.js to copy over theme config and variables. โ”‚
โ”‚ Head over to the docs for detailed information on how to make changes to the theme. โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of react-native@>=0.43.0 but none was installed.
npm WARN [email protected] requires a peer of react@>=16.0.0-alpha.3 but none was installed.
npm WARN [email protected] requires a peer of react-native@>=0.43.0 but none was installed.
npm WARN [email protected] requires a peer of react@>=16.0.0-alpha.3 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of react@^15.0.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of react-native@>=0.28.0 but none was installed.

  • [email protected]
    added 19 packages, removed 568 packages and updated 73 packages in 16.091s

Most helpful comment

I believe the issue is with npm as I've encountered it by installing other packages (react-navigation, firebase etc). I was able to consistently resolve the issue reinstalling react native with "npm install react-native --save"

All 4 comments

Try to remove yarn if you are using it
Somehow it fixes it for me

@jrempel1 Could you get it to work?
It's working fine for me.

I think it's a version compatibility issues. i downgrade react-native to 0.43.0, react and react-test-renderer to 16.0.0-alpha.3. and it works.

here's what i did :

1. edit package.json file and downgrade versions like this :

"dependencies": {
        "native-base": "2.1.1",
        "react": "16.0.0-alpha.3",
        "react-native": "0.43.0"
    },
    "devDependencies": {
        "babel-jest": "20.0.3",
        "babel-preset-react-native": "2.0.0",
        "jest": "20.0.4",
        "react-test-renderer": "16.0.0-alpha.3"
    }

2. if you have package-lock.json file then delete it.
3. npm install

Hope this helps.

I believe the issue is with npm as I've encountered it by installing other packages (react-navigation, firebase etc). I was able to consistently resolve the issue reinstalling react native with "npm install react-native --save"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agersoncgps picture agersoncgps  ยท  3Comments

eggybot picture eggybot  ยท  3Comments

natashache picture natashache  ยท  3Comments

elnygren picture elnygren  ยท  3Comments

Bundas picture Bundas  ยท  3Comments