react-native-ble-plx icon indicating copy to clipboard operation
react-native-ble-plx copied to clipboard

'react-native link' unrecognized

Open rpiwetz opened this issue 9 years ago • 35 comments

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" }

rpiwetz avatar Jun 27 '17 15:06 rpiwetz

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

Cierpliwy avatar Jun 29 '17 08:06 Cierpliwy

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

inev avatar Jun 29 '17 17:06 inev

@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.

rpiwetz avatar Jul 13 '17 21:07 rpiwetz

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.

sakettawde avatar Aug 26 '17 18:08 sakettawde

same! yarn FTW~

hhff avatar Sep 07 '17 18:09 hhff

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.

jonrh avatar Oct 25 '17 09:10 jonrh

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

Cierpliwy avatar Oct 28 '17 09:10 Cierpliwy

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

volkansahin45 avatar Nov 29 '17 19:11 volkansahin45

About which folder name are you talking about @volkansahin45?

Cierpliwy avatar Nov 29 '17 19:11 Cierpliwy

@Cierpliwy the application folder

volkansahin45 avatar Nov 29 '17 19:11 volkansahin45

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

sangampandey avatar Dec 15 '17 20:12 sangampandey

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

rastogitech avatar Jan 02 '18 08:01 rastogitech

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

This sequence worked for me

mayankzen1 avatar Jan 02 '18 13:01 mayankzen1

Did it work in expo un-detached project?

rastogitech avatar Jan 03 '18 04:01 rastogitech

@sangampandey thanks your solution worked for me

naxir avatar Jan 04 '18 07:01 naxir

I run the npm install and my problem was solved

bashirpour avatar May 06 '18 13:05 bashirpour

no one solution is running for me

zero1world avatar Nov 19 '18 08:11 zero1world

Me too, none of them works for me.

ZeldaYuan avatar Dec 06 '18 19:12 ZeldaYuan

npm install inside the project folder solved the problem.

TheBlackHacker avatar Dec 10 '18 07:12 TheBlackHacker

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[bot] avatar Apr 01 '19 11:04 stale[bot]