Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'react-native link' unrecognized #98

Closed
rpiwetz opened this issue Jun 27, 2017 · 35 comments
Closed

'react-native link' unrecognized #98

rpiwetz opened this issue Jun 27, 2017 · 35 comments
Labels

Comments

@rpiwetz
Copy link

rpiwetz commented Jun 27, 2017

Started with a new project:
react-native init appName
cd appName
Verified that react-native link works. Successful
Added react-native-ble-plx:
npm install --save react-native-ble-plx
Tried react-native link, receive error:
"Command link unrecognized. Make sure that you have run npm install and that you are inside a react-native project."

"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.45.1",
"react-native-ble-plx": "^0.6.0"
}

@Cierpliwy
Copy link
Contributor

I did the same thing as you and react-native link command resulted in:

Scanning 558 folders for symlinks in /Users/cierpliwy/git/appName/node_modules (5ms)
rnpm-install info Linking react-native-ble-plx android dependency 
rnpm-install info Android module react-native-ble-plx has been successfully linked 
rnpm-install info Linking react-native-ble-plx ios dependency 
rnpm-install info iOS module react-native-ble-plx has been successfully linked

@inev
Copy link

inev commented Jun 29, 2017

I have the same issue. I was able to get around it by deleting node_modules and typing yarn.

@rpiwetz
Copy link
Author

rpiwetz commented Jul 13, 2017

@inev, thank you, that fixed it for me. Tried with brand new RN app again and ran into the issue, so deleted node_modules and ran yarn...so had to sit through the building of all those framework files twice, but at least it works now.

@sakettawde
Copy link

sakettawde commented Aug 26, 2017

Thanks @inev, had the same problem, repeated the same steps, deleted node_modules folder and ran 'yarn' command and then ran 'react-native link', seemed to work then.

@hhff
Copy link

hhff commented Sep 7, 2017

same! yarn FTW~

@jonrh
Copy link

jonrh commented Oct 25, 2017

Fell victim to this. My mistake was that I ran react-native link inside the wrong folder. I was in the android/ folder. For react-native link to work you need to be located at the root of your React Native project.

This is because the command react-native only has the command init available globally. All other commands, for example link, rely on the React Native version you have installed in node_modules.

@Cierpliwy
Copy link
Contributor

Cierpliwy commented Oct 28, 2017

I'll add note to README file. I was also confused about it.

@volkansahin45
Copy link

volkansahin45 commented Nov 29, 2017

Make sure your folder name and package.json name are equals. I made that mistake, I accidently changed the name in the package.json

@Cierpliwy
Copy link
Contributor

About which folder name are you talking about @volkansahin45?

@volkansahin45
Copy link

@Cierpliwy the application folder

@sangampandey
Copy link

I believe this happens after you add any new library merely run yarn install after adding any library and later react-native link should definitely work

@rastogitech
Copy link

react-native link can not be used in "create-react native-app" projects.

@mayankzen123
Copy link

npm install native-base --save
npm install
react-native link

This sequence worked for me

@rastogitech
Copy link

Did it work in expo un-detached project?

@naxir
Copy link

naxir commented Jan 4, 2018

@sangampandey thanks your solution worked for me

@bashirpour
Copy link

bashirpour commented May 6, 2018

I run the npm install
and my problem was solved

@zero1world
Copy link

no one solution is running for me

@ZeldaYuan
Copy link

Me too, none of them works for me.

@TheBlackHacker
Copy link

npm install inside the project folder solved the problem.

@stale
Copy link

stale bot commented Apr 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 1, 2019
@stale stale bot closed this as completed Apr 8, 2019
@Usamaliaquat123
Copy link

this no solution worked for me ...!

@Memexp
Copy link

Memexp commented Apr 25, 2019

Me neither, it still says:

bash: react-native: command not found

@shusain
Copy link

shusain commented Aug 1, 2019

@Memexp you need to install react-native globally for the command to be found in your path npm install -g react-native-cli or yarn add global react-native-cli

For others here too delete your node_modules and package-lock.json file then run yarn to install dependencies with yarn then attempt link again and use yarn to run, worked for me.

@rinardmorais
Copy link

npm install react-native-firebase work!

@shusain
Copy link

shusain commented Aug 29, 2019

Correction on what I said above (will edit as well) the globally installed package should be react-native-cli not react-native( this one should just be installed with a regular npm install in your project not globally) this will make the react-native commands available to use anywhere (assuming node module globals bin is in your system path)

S00141-mbpr:randomFolder shaun.husain$ react-native --version
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
S00141-mbpr:randomFolder shaun.husain$ cd projectFolder
S00141-mbpr:projectFolder shaun.husain$ react-native --version
react-native-cli: 2.0.1
react-native: 0.60.5
S00141-mbpr:projectFolder shaun.husain$

@kest-cloud
Copy link

it really worked.....remove node_modules and run Yarn....worked perfectly. thanks so much

@daminduLiyanage
Copy link

daminduLiyanage commented Sep 28, 2019

This should work:
npm install --save react-native-firebase
react-native link react-native-firebase

@matheusfaggi
Copy link

I try remove node_modules then run yarn, but does not work. I was adding dependencies directly on package.json. Now i try add each dependecies using yarn add, and work it.

@zacdemi
Copy link

zacdemi commented Jan 26, 2021

In my case I was using npx create-react-app my-app instead of npx create-react-native-app

@kirbi96
Copy link

kirbi96 commented Jun 30, 2022

if you want add fonts, for react native 0.69 run
npx react-native-asset

@Zontex
Copy link

Zontex commented Jul 3, 2022

if you want add fonts, for react native 0.69 run npx react-native-asset

Saved my life.

@TravisHi
Copy link

if you want add fonts, for react native 0.69 run npx react-native-asset

Do we still have to configure the react-native.config.js?

@mothy900
Copy link

if you want add fonts, for react native 0.69 run npx react-native-asset

Saved my life 2222 Thanks!!!!!!!

@Zhouwenli
Copy link

react-native link不能用于“create-react native-app”项目。

为什么?

@hannan228
Copy link

hannan228 commented May 21, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests