React-native: error #jest/create-cache-key-function#27.4.2: The engine "node" is incompatible with this module. Expected version - react-native

I am almost starter on react-native. Trying to create a new project but I get the below error. I am using Windows 7, latest applicable node version for my operating system is 13.14.0. Is it about this? Any help is appreciated.
[2/4] Fetching packages...
error #jest/create-cache-key-function#27.4.2: The engine "node" is incompatible with this module. Expected
version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0". Got "13.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Command failed: yarn add react-native --exact
at checkExecSyncError (child_process.js:611:11)
at execSync (child_process.js:647:15)
at run (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
at createProject (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
at Object.<anonymous> (C:\Users\SAMSUNG\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 9344,
stdout: null,
stderr: null
}
Command `yarn add react-native --exact` failed.

At first line of the error, it is written that,
"Expected version "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
so you Need to update Node version.

Related

nrwl NX init fails in make-angular-cli-faster init

I have an existing angular cli project (V12.2.16).
Im trying to migrate it to an NX standalone Application with the command :
npx nx init
Im getting an error:
Error: Command failed: npx --yes make-angular-cli-faster#latest init
at checkExecSyncError (child_process.js:790:11)
at execSync (child_process.js:863:15)
at Object.<anonymous> (C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\init.js:22:46)
at Generator.next (<anonymous>)
at C:\Code\harmony-encore-fe\node_modules\tslib\tslib.js:167:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\Code\harmony-encore-fe\node_modules\tslib\tslib.js:163:16)
at Object.initHandler (C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\init.js:12:20)
at C:\Code\harmony-encore-fe\node_modules\#nrwl\cli\node_modules\nx\src\command-line\nx-commands.js:207:71
at Generator.next (<anonymous>) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 10148,
stdout: null,
stderr: null
}
I tried running the command npx --yes make-angular-cli-faster#latest init
Standalone but it gives me the following error:
The system cannot find the path specified.
Any suggestions on how to solve such an issue ?
Thanks.
Tried to migrate to an NX standalone application and was expecting to migrate succcesfyly but the result was an error thrown from NX.
Which NodeJs version are you using?
I had the same error while I was running npx nx init on NodeJs 14.19.3 and it works fine running it on NodeJs 16.16.0.
I hope it helps.

Whenever I try to run yarn start I get this error message

node:internal/errors:490
ErrorCaptureStackTrace(err);
^
Error: spawn ENOTDIR
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:757:9)
at spawn (/Users/ni/Desktop/WORK/RET/LEAING/ToGo/.yarn/cache/cross-spawn-npm-6.0.5-2deab6c280-f893bb0d96.zip/node_modules/cross-spawn/index.js:12:24)
at run (/Users/ni/Desktop/WORK/RET/LEAING/ToGo/.yarn/unplugged/expo-npm-47.0.13-9da3537782/node_modules/expo/bin/cli.js:11:12)
at Object. (/Users/ni/Desktop/WORK/RET/LEAING/ToGo/.yarn/unplugged/expo-npm-47.0.13-9da3537782/node_modules/expo/bin/cli.js:6:1)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at require$$0.Module._extensions..js (/Users/ni/Desktop/WORK/RET/LEAING/ToGo//.pnp.cjs:21020:33)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at require$$0.Module._load
(/Users/ni/Desktop/WORK/RET/LEAING/ToGo//.pnp.cjs:20839:22) {
errno: -20,
code: 'ENOTDIR',
syscall: 'spawn'
}
node version : v18.14.0
npm version: 9.4.1
yarn version: 3.4.1
expo version: WARNING: The legacy expo-cli does not support Node +17. Migrate to the versioned Expo CLI (npx expo).
6.3.0
React Native version: 0.71
Thank you in advance.
If i try using npm it works (npx create-expo-app AwesomeProject),
but I want to use yarn.
Try updating the expo CLI to a version that is compatible with Node version 18.14.0 by running the command "npx expo".

Using npm to install puppetteer gives Error: Cannot find module 'puppeteer/internal/node/install.js'

Trying to install puppeteer on Centos 7
npm i puppeteer
> puppeteer#19.4.1 postinstall /mypath/node_modules/puppeteer
> node install.js
internal/modules/cjs/loader.js:775
throw err;
^
Error: Cannot find module 'puppeteer/internal/node/install.js'
Require stack:
- /mypath/node_modules/puppeteer/install.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
at Function.Module._load (internal/modules/cjs/loader.js:677:27)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (/mypath/node_modules/puppeteer/install.js:38:27)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/mypath/node_modules/puppeteer/install.js'
]
}
It doesn't seem to have downloaded anything into the node_modules/ directory, which I think "npm i" should do, and all of the tutorials I have read do not ask you perform any action or download, before running the npm command.
What do I need to do, to make this install puppeteer? (with chrome)
I was getting this error because my node version was too old (version 10) but fixed it by switching to version 16.
To fix this I used nvm from the command line as follows:
nvm use 16
nvm alias default 16

Getting error while trying to install vuestorefront using npm

I am getting the below error while trying to install vuestorefront using npm on windows. Any idea how to fix it ?
TSError: тип Unable to compile TypeScript:
core/scripts/server.ts:1:38 - error TS2307: Cannot find module '#vue-storefront/core/server/hooks' or
its corresponding type declarations.
1 import { serverHooksExecutors } from '#vue-storefront/core/server/hooks'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at createTSError (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:434:12)
at reportTSError (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:438:19)
at getOutput (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:578:36)
at Object.compile (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:775:32)
at Module.m._compile (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:858:43)
at Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Object.require.extensions.<computed> [as .ts] (D:\vueRepo\vue-storefront\vue-storefront\node_modules\ts-node\src\index.ts:861:12)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
vue-storefront works better with yarn. Try to update your yarn, then yarn install and yarn dev. More informations can be found here.

`react-native init AwesomeProject` throwing SyntaxError

react-native init AwesomeProject is throwing SyntaxError: Unexpected token : and I'm not sure why. I've uninstalled and re-installed react-native-cli. Tried with and without yarn. Any suggestions?
mes-MBP:myproject me$ react-native init AwesomeProject
This will walk you through creating a new React Native project in /Users/me/WebstormProjects/myproject/AwesomeProject
Using yarn v0.17.10
Installing react-native...
/Users/me/WebstormProjects/myproject/AwesomeProject/node_modules/react-native/local-cli/util/Config.js:43
cwd: string,
^
SyntaxError: Unexpected token :
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at loader (/Users/me/WebstormProjects/myproject/AwesomeProject/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/me/WebstormProjects/myproject/AwesomeProject/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/me/WebstormProjects/myproject/AwesomeProject/node_modules/react-native/local-cli/cliEntry.js:13:16)
at Module._compile (module.js:413:34)
Looks like the error an update was published to react-native. Others are experiencing the same issue so I'm going to answer this and say it's a package issue. https://github.com/facebook/react-native/issues/11384
Until this gets resolved, you can use rninit(https://www.npmjs.com/package/rninit) to install using the previous version of react-native. This worked for me:
rninit init mobile --source react-native#0.39.0
Update node version on OS.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Apparently the new version React Native 0.56.0 has this problem.
To fix this problem, you can install the previous version.
react-native init --version="0.55.0" MyNewApp