Open georgeanthonyvalentine opened 3 years ago
Iβve tried using WebStorm 2021 to create a project: File -> New Project > React Native, then click Create button, it will execute execute and output log like in the bottom, and finally it will create a project like this: App.js android babel.config.js ios node_modules yarn.lock tests app.json index.js metro.config.js package.json And in package.json is something like this: { "name": "testrn", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "17.0.1", "react-native": "0.64.2" }, "devDependencies": { @./core": "^7.14.8", @./runtime": "^7.14.8", @.***/eslint-config": "^3.0.0", "babel-jest": "^27.0.6", "eslint": "^7.32.0", "jest": "^27.0.6", "metro-react-native-babel-preset": "^0.66.2", "react-test-renderer": "17.0.1" }, "jest": { "preset": "react-native" } } And now the RN console plugin works as expected. If your package.json is in somewhere but not in the project root dir, you can click the link Edit Js project working directory (Optional, if it's not under root directory) To tell the plugin where it is. Please make sure your project could be run by using command line, my plugin doesnβt have the ability to setup the React Native development env, you have to follow it at: Setting up the development environment Β· React Native, and follow the instruction at React Native CLI Quickstart tab.
/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npx-cli.js --ignore-existing --package react-native-cli react-native init testrn
yes
npx: installed 81 in 20.329s
prompt: Directory testrn already exists. Continue?: (no) yes
This will walk you through creating a new React Native project in /Users/beansoft/Documents/test/testrn
Using yarn v1.17.3
Installing react-native...
yarn add v1.17.3
info No lockfile found.
[1/4] π Resolving packages...
warning react-native > @react-native-community/cli-platform-ios > xcode > @.: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning react-native > @react-native-community/cli > metro > metro-minify-uglify > @.: support for ECMAScript is superseded by uglify-js
as of v3.13.0
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > @.: https://github.com/lydell/resolve-url#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > @.: Please see https://github.com/lydell/urix#deprecated
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "react-native > @." has unmet peer dependency @./core@*".
warning "react-native > @." has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "react-native > react-native-codegen > @." has unmet peer dependency @./preset-env@^7.1.6".
warning " > @." has unmet peer dependency @.".
[4/4] π¨ Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.22.5", while you're on "1.17.3".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
success Saved 382 new dependencies.
β¨ Done in 46.56s.
info Setting up new React Native app in /Users/beansoft/Documents/test/testrn
info Adding required dependencies
yarn add v1.17.3
[1/4] π Resolving packages...
warning @react-native-community/eslint-config > @.: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "react-native > react-native-codegen > @." has unmet peer dependency @./preset-env@^7.1.6".
warning @./eslint-config > @typescript-eslint/eslint-plugin > @." has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] π¨ Building fresh packages...
success Saved lockfile.
success Saved 198 new dependencies.
info Direct dependencies
β¨ Done in 26.71s. info Adding required dev dependencies yarn add v1.17.3 [1/4] π Resolving packages... [2/4] π Fetching packages... warning Pattern @./core@^7.14.8"] is trying to unpack in the same destination @*.**@*./core" as pattern @./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@@./core@^7.14.0"]. This could result in non-deterministic behavior, skipping. warning Pattern @./runtime@^7.14.8"] is trying to unpack in the same destination @*.**@*./runtime" as pattern @./runtime@^7.8.4"]. This could result in non-deterministic behavior, skipping. [3/4] π Linking dependencies... warning "react-native > react-native-codegen > @." has unmet peer dependency @./preset-env@^7.1.6". warning @./eslint-config > @typescript-eslint/eslint-plugin > @." has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". [4/4] π¨ Building fresh packages... success Saved lockfile. success Saved 65 new dependencies.
β¨ Done in 13.79s.
info Installing required CocoaPods dependencies
(node:4897) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./testrn/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
at runPodInstall @.***/cli/build/tools/installPods.js:98:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:4897) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:4897) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done
I have tried various different ways to install the package.json i have tried through yarn and npm as a global install however when i open the react native console in webstorm it still appears to not reconize the package.json on the global scale.