yarn is required to install this library with npm
See original GitHub issueBug
Installing this package using npm
throws this error:
npm ERR! prepareGitDep sh: yarn: command not found
npm ERR! prepareGitDep npm ERR! code ELIFECYCLE
npm ERR! prepareGitDep npm ERR! syscall spawn
npm ERR! prepareGitDep npm ERR! file sh
npm ERR! prepareGitDep npm ERR! errno ENOENT
npm ERR! prepareGitDep npm ERR! react-native-device-info@5.4.1 prepare: `yarn build`
npm ERR! prepareGitDep npm ERR! spawn ENOENT
npm ERR! prepareGitDep npm ERR!
npm ERR! prepareGitDep npm ERR! Failed at the react-native-device-info@5.4.1 prepare script.
It appears it expects yarn
to be installed. If this is expected, it would be helpful if the documentation states as such. However, the docs state you can use either npm
or yarn
.
Environment info
React native info output:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 128.77 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v10.16.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 25, 26, 27, 28, 29
Build Tools: 28.0.2, 28.0.3, 29.0.0
System Images: android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
react: ^16.9.0 => 16.12.0
react-native: ^0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
react-native: 0.59.10
Library version: 5.4.1
Steps To Reproduce
- Ensure “yarn” is not installed
- Run “npm i” on a project depending on this library. …
Describe what you expected to happen:
- Installation completes successfully
Reproducible sample code
N/A
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
How To Install and Use the Yarn Package Manager for Node.js
Yarn has a unique way of installing and running itself in your JavaScript projects. First you install the yarn command globally, then you...
Read more >yarn install
yarn install is used to install all dependencies for a project. This is most commonly used when you have just checked out code...
Read more >yarn is required to install this library with npm #1359 - GitHub
We recently ran into an issue on a clean install using npm install - full log attached, and relevant excerpt below: 4038 verbose...
Read more >Yarn vs npm: Everything You Need to Know - SitePoint
To avoid package version mismatches, an exact installed version is pinned down in a package lock file. Every time a module is added,...
Read more >yarn - npm
Fast: Yarn caches every package it has downloaded, so it never needs to download the same package again. It also does almost everything ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the record, I was not making a judgement call on yarn vs npm 😀
npm is packaged with node whereas yarn is optional, so at least for any path a normal user would take, yes, please PR away. I don’t like mixing dependency managers but I also prefer yarn personally (as do the other maintainers here) so for non-essential (i.e., maintainer-only commands) I think it’s a toss up. Probably should pick one and go with it (which would be npm I suppose. @Johan-dutoit what do you think? I’m inclined to just say “okay, it’s npm now” and move on, feels like it could turn into something like a whitespace debate otherwise, but maybe I’m missing something?