Error: Failed to load plugin 'prettier' declared in '.eslintrc.js » @react-native-community/eslint-config': Cannot find module 'eslint-plugin-prettier' Require stack:
See original GitHub issueAfter installing react-native with npx it throws an error on me with eslint settings in webstorm.
Description
I have tried installing prettier on it’s own but it didn’t worked
React Native version: 0.65.1
Run react-native info
in your terminal and copy the results here.
info Fetching system and libraries information…
System:
OS: macOS 11.5.2
CPU: (8) arm64 Apple M1
Memory: 179.45 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.8.0 - /opt/homebrew/bin/node
Yarn: Not Found
npm: 7.21.0 - /opt/homebrew/bin/npm
Watchman: 2021.08.30.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.0 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: Arctic Fox 2020.3.1 Patch 2 Arctic Fox 2020.3.1 Patch 2
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.65.1 => 0.65.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- npx react-native some
- open app in webstorm
Expected Results
Describe what you expected to happen. no errors is shown
Snack, code example, screenshot, or link to a repository:
I haven't changed anything from the app created with npxIssue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:20 (1 by maintainers)
Top GitHub Comments
I think it’s all caused by peer dependency in npm >=7. In my case, installing dependencies in the old npm 4-6 mode helped, i.e.:
npm install --legacy-peer-deps
Article about dependencies:
I should mention that running the linter by itself also throws this error (not just VSCode).
Installing as instructed/recommended that moves the error to a missing
prettier
config package.Installing
eslint-config-prettier
in turn mentions an issue withglobals/jest
.