New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: cli.init is not a function #34055
Comments
I am also getting same issue /usr/local/lib/node_modules/react-native-cli/index.js:302 TypeError: cli.init is not a function |
That is error is from the new version 0.69.0 |
|
Thank You |
all of them not work |
getting the same error! |
Even if you down grade the version. Once you try to run the project if fails anyway. I think it's related to the new Mac OS upgrade and the hardening of permissions. Please note here that I'm presuming this is only happening on Mac. |
Could you please explain how to upgrade to 0.69.0 later and what exactly is causing this issue due to version change? |
This error is happening on windows as well! I temporarily fixed it by downgrading to last version |
Could you please explain how to upgrade to 0.69.0 later and what exactly is causing this issue due to version change? |
I had the same issue on windows... using version 0.68.2 solved the problem |
Hi, How to upgrade ? |
thank you so much |
The issue is caused by having some globally installed Yarn/NPM packages which is not generally recommended. Depending on the commands you installed in the past with
Make sure the global packages are clean with:
(check that nothing react-native related is available in those lists). |
just change the package version in package.json and npm install and if u wish u can remove node_modules before npm install But anyways 69 doesn't fix the problem yet, so continue with 68.2 |
If you go to yarn page they have global install
…Sent from my iPhone
On 25 Jun 2022, at 10:59 pm, Bsingh2697 ***@***.***> wrote:
That is error is from the new version 0.69.0
You can use npx react-native init ProjectName --version 0.68.2 and then upgrade to v 0.69 later.
Thank You
Could you please explain how to upgrade to 0.69.0 later and what exactly is causing this issue due to version change?
just change the package version in package.json and npm install and if u wish u can remove node_modules before npm install
—
Reply to this email directly, view it on GitHub<#34055 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APN3NJ7V32NMUUIX26K6RA3VQ37DXANCNFSM5ZTW6X6A>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This worked for me. Thanks! |
This worked for me. Thanks! |
This worked for me. Thanks! |
update react-native and react-native cli as global |
yarn global remove react-native then install again yarn add global react-native good luck |
Many thanks. |
thanks so much |
from the below info: |
npx react-native init ProjectName --version 0.68.2 worked for me |
No problem now, you can build your project directly using |
When you use npx react-native init InsertProjectNameHere --version 0.68.2 --template react-native-template-typescript nothing happens exept it fails with RuntimeError: abort(Error: Command failed: yarn add react-native-template-react-native-template-typescript~) how do you get around that? Because I want to use TypeScript not JavaScript |
So after uninstalling what are we to do next? |
@benjamineruvieru After uninstalling, reinstall globally and then create a project, it can be created successfully. |
You might be using old react-native-cli. Maybe you should try uninstalling and react-native-cli globally and reinstalling it. |
TY @emorilebo, That worked & I didn't even realize that I had the old version of the react-native-cli installed |
I am using MacOS 12.4 and for me When i was created the React Native app using npm it is showing like this
Give me a solution!!! |
Did you try without that exact flag?
…On Fri, 22 Jul 2022 at 16:01, Vithushan Logeswaran ***@***.***> wrote:
I am using MacOS 12.4 for me When i creates the React Native app using npm
it is showing like this
*I used cli 0.68.2*
Visit https://yarnpkg.com/en/docs/cli/add for documentation about this
command. Error: Command failed: yarn add ***@***.*** --exact at
checkExecSyncError (child_process.js:790:11) at execSync
(child_process.js:863:15) at run
(/Users/vithushan/.config/yarn/global/node_modules/react-native-cli/index.js:294:5)
at createProject
(/Users/vithushan/.config/yarn/global/node_modules/react-native-cli/index.js:249:3)
at init
(/Users/vithushan/.config/yarn/global/node_modules/react-native-cli/index.js:200:5)
at Object.<anonymous>
(/Users/vithushan/.config/yarn/global/node_modules/react-native-cli/index.js:153:7)
at Module._compile (internal/modules/cjs/loader.js:1085:14) at
Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at
Module.load (internal/modules/cjs/loader.js:950:32) at
Function.Module._load (internal/modules/cjs/loader.js:790:12) { status: 1,
signal: null, output: [ null, null, null ], pid: 36901, stdout: null,
stderr: null } Command yarn add ***@***.*** --exact failed.
Give me a solution for me!!!
—
Reply to this email directly, view it on GitHub
<#34055 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI2I3MVRZELSXKPB4QWMGHDVVKZVRANCNFSM5ZTW6X6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This works for me, thanks @emorilebo |
Actually latest version (0.69.0) still not working. so please try below steps yarn global remove react-native then install again yarn add global react-native |
Worked for me too. Thanks! |
I just run below command and it works for me |
I fixed it. Thanks for replying
…On Wed, 31 Aug 2022, 9:00 am Mr.Tian, ***@***.***> wrote:
What is your node version?
—
Reply to this email directly, view it on GitHub
<#34055 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AS4S2RCAAC2V5MRBMZ6264LV33KEPANCNFSM5ZTW6X6A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I fixed by deleting folder: Now it is working for me. I think it is old which is completely not deleted. |
Are there any fixes in the latest version? When creating a project in (I'm using |
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues: npm uninstall -g react-native-cli @react-native-community/cli . it works for me. good luck guys. |
26 Dec. I have the same error:
Only running with 'react-native init MyApp --version 0.68.2' fixed the issue |
Surprisingly none of above worked for me other than:
Please also make sure you've correct version of ruby |
It's do as ran as administrator mode ?? |
npx react-native@X.XX.X init project--version X.XX.X |
I got it working after going to /Users/{{username}}/node_modules (using Mac), and manually removed folders "react-native", "react-native-cli", "@react-native" |
thanks. This also work with WebStorm new react native project npx --package react-native-cli react-native --version 0.68.2Then inside project. Update manually from package.json, then run npm install on terminal |
Description
npx react-native init Name
throws when creating a template with RN v0.69Version
0.69.0
Output of
npx react-native info
yarn v1.22.19
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
So I can't
npx react-native info
Steps to reproduce
Just do
npx react-native init Name
using macOS 12.4, Intel.Snack, code example, screenshot, or link to a repository
/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:302
cli.init(root, projectName);
^
TypeError: cli.init is not a function
at run (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:302:7)
at createProject (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:249:3)
at init (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:200:5)
at Object. (/Users/user/.config/yarn/global/node_modules/react-native-cli/index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader:1112:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:834:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Node.js v18.4.0
The text was updated successfully, but these errors were encountered: