Error running npx to create a react-native project - react-native

I'm trying to create a new project with typescript template using npx like this
npx react-native init AwesomeTSProject --template react-native-template-typescript
It creates the folder but it shows me this error
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing dependencies
error Error: Command failed: yarn install
warning react-native > #react-native-community/cli-platform-ios > xcode > uuid#3.4.0: 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 > #react-native-community/cli-plugin-metro > metro > jest-haste-map > sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning react-native > #react-native-community/cli > #react-native-community/cli-plugin-metro > metro > metro-minify-uglify > uglify-es#3.3.9: 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#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning #react-native-community/eslint-config > babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
error #typescript-eslint/eslint-plugin#5.12.1: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "15.14.0"
error Found incompatible module.
yarn install v1.22.17
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I've checked both https://yarnpkg.com/en/docs/cli/install & https://v8.dev/blog/math-random but can't find the issue, I've checked over here in Stack Overflow but didn't find anything.

In my case upgrading the node version solved the issue.

In my case run this command
npx react-native init YourProjectHere --template react-native-template-typescript --npm

I am running ZORIN OS(UBUNTU) so after adding sudo did job for me.
sudo npx react-native init ProjectName

I had the same issue where my yarn version was 3.2.0
Then I did reset it to yarn set version 1.22.1 and it worked well my node version is 18

Related

yarn install warning "xxx > xxx > xxx" has incorrect peer dependency "xxx"

When I run yarn install, the command line output is as follows:
warning "#umijs/preset-react > #umijs/plugin-dva > dva#2.6.0-beta.22" has incorrect peer dependency "react#^16.8.4".
warning "#umijs/preset-react > #umijs/plugin-dva > dva#2.6.0-beta.22" has incorrect peer dependency "react-dom#^16.8.4".
warning "#umijs/preset-react > #umijs/plugin-dva > dva-loading#3.0.22" has unmet peer dependency "dva-core#^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning "#umijs/preset-react > #umijs/plugin-locale > react-intl#3.12.1" has incorrect peer dependency "react#^16.3.0".
warning "#umijs/preset-react > #umijs/plugin-request > #ahooksjs/use-request#2.8.3" has incorrect peer dependency "react#^16.8.6".
My yarn version is 1.22.10.
This mean's there is some error with the dependencies warned about, but this shouldn't stop yarn from moving forward, to fix this you would have to upgrade yarn, running the command below you upgrade yarn:
yarn upgrade --latest
When yarn is fully updated, reinstall the dependencies using the same yarn install.

ENOSYS: function not implemented

I recently install next js use to npm in raspi 4 with the raspbian operating system. Every time when I install react js, next js, and gatsby show me the same error.
At this time I install nextjs use yarn. also, I use npm and npx to show the same error. so I started to find a solution then somebody told me to use sudo so I use sudo but doesn't work
sudo yarn create next-app
check my code error output
pi#raspberrypi:/media/pi/8243-BE00/next $ sudo yarn create next-app
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app#10.0.5" with binaries:
- create-next-app
✔ What is your project named? … myapp
Creating a new Next.js app in /media/pi/8243-BE00/next/myapp.
Installing react, react-dom, and next using yarn...
yarn add v1.22.10
info No lockfile found.
[1/4] Resolving packages...
warning next > chokidar > fsevents#2.1.3: "Please update to latest v2.3 or v2.2"
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning next > resolve-url-loader > rework > css > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.1: The platform "linux" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
info If you think this is a bug, please open a bug report with the information provided in "/media/pi/8243-BE00/next/myapp/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom next --cwd /media/pi/8243-BE00/next/myapp has failed.
Done in 293.09s.
pi#raspberrypi:/media/pi/8243-BE00/next $
You can try this next:
Remove yarn.lock.
Remove node_modules.
Use the --ignore-optional FLAG (yarn --ignore-optional); these don’t install optional dependencies.
The fsevents package is for macOS only; you don't need it in Linux.
If any of that works you can remove ignore and see if .yarnclean works.
Based on the log, looks like script is not able to create symbolic link
"ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
What is the file system you are using? I know exFAT and FAT32 don't support symbolic link.
Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/filesystem-functionality-comparison

Build React-Native

I have this problem when trying to install some items
example:yarn add react-navigation;
warning " > react-native-paper#3.10.1" has unmet peer dependency "react-native-vector-
icons#*".
[5/5] 🔨 Building fresh packages...
[-/9] ⠈ waiting...
[6/9] ⠈ lib-jitsi-meet
[7/9] ⠁ node-sass
[8/9] ⠁ ejs
error /node_modules/lib-jitsi-meet: Command failed.
Exit code: 127
Command: webpack -p
Arguments:
As suggested in error you have to install react-native-vector-icons, which is the dependency of the react-native-paper. So go first install react-native-vector-icon and then try to install another package. Here is the documentation of how to install react-native-vector-icon.

core-js dependencies warning [vue]

I have vue.js application. when using
yarn install.
Then, warning shows up as below
warning #vue/cli > #vue/cli-ui > vue-cli-plugin-apollo > apollo > git-parse > babel-polyfill > core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
warning #vue/cli > #vue/cli-ui > vue-cli-plugin-apollo > apollo > git-parse > babel-polyfill > babel-runtime > core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
in my package.json file, the version of core-js is already ^3
"dependencies": {
...
"#vue/cli": "^4.2.2",
"core-js": "^3",
...
},
I wonder if there are anyone who got same issue, and I appreciate it if someone would have any info, any solutions.
It is not a problem with your application or library itself, it's a warning by a dependency of a dependency of a dependency (and so on) of a library you added.
Try perform a security update with:
npm audit
or
yarn audit
then:
npm audit fix
or
yarn audit fix
which will try to solve your security issues.
Remember to test everything before committing, because there could be breaking changes.

npm - meaning of "Have you installed one of peer libraries?"

npm version: 5.6.0
While doing npm install [package] got the following sentence (warning?):
Have you installed one of peer libraries?
Is it a warning? What does it means?
Could not find it documented anywhere.
Example:
npm i material-ui-pickers
Have you installed one of peer libraries?
> date-fns
> luxon
> moment
+ material-ui-pickers#1.0.0-rc.9
updated 1 package in 77.671s
If you look at material-ui-pickers > package.json under you node_modules folder, you will see that the message is a post-install message. As Sebastiaan stated, it's simply material-ui-pickers advertising other modules or potential dependencies when the installation is complete.