"Trying to initialize a new React Native project using 'npx react-native init

When trying to create a new react-native project using the command below in the visual studio terminal:

npx react-native init project-name

The terminal seems to freeze for about 10 minutes at this line:

⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠇ rollbackFailedOptional: verb npm-session e582ffa365b35dcf

Screenshot

https://i.stack.imgur.com/lMsqL.png

I have attempted various solutions, but unfortunately, none of them have proven effective.

Interestingly, when I used the command npx create-react-app teachat, it ran smoothly. This has left me puzzled as to whether the issue lies with npm or react-native.

Answer №1

There are several factors that could lead to this issue manifesting.

1. Connectivity Problems: Sometimes, although your internet connection seems fine, certain applications may cause disruptions when downloading dependencies. In such cases, switching to a different network might help resolve the issue.

  1. Attempt uninstalling react-native-cli from global installation using the command
    npm uninstall -g react-native-cli

3. Experiment with different versions or templates like typescript by utilizing commands such as

npx react-native init projectname --version X.XX.X
or
npx react-native init AwesomeTSProject --template react-native-template-typescript

Answer №2

Creating react native projects using the react native cli is no longer recommended, as the init method is now preferred. For detailed instructions, refer to the official documentation section on creating a new application.

To start a new project, make sure to uninstall react-native-cli and instead use the following command:

npx react-native init projectname

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Struggling to showcase JSON information, encountering a JSON Parsing issue

I'm currently facing an issue with displaying JSON data on my screen, specifically the integer 4. Unfortunately, I keep encountering a JSON Parse Error whenever I try to retrieve and show the data. Even though the data appears to be successfully pos ...

npm is currently unable to fetch packages from the registry at registry.npmjs.org

I am encountering the following error message when trying: npm search rollup npm ERR! pna.nextTick is not a function npm ERR! code ECONNRESET npm ERR! network tunneling socket could not be established, statusCode=503 npm ERR! network This is a problem re ...

Turn off the interconnected route while utilizing npm to display the tree of dependencies

If I want to display the project's dependencies tree using npm, I would use the following command: npm ls lodash The output will look something like this: > npm ls lodash npm info using [email protected] npm info using [email protected] ...

Can a package-lock.json file be created without running an npm install command?

Is there a way to create only a package-lock.json file without having to redo the npm install process? I'm looking to generate the lock file without reinstalling any of the package files. Is this achievable? ...

Experiencing difficulties with arrays in JavaScript while using React Native

Programming Challenge let allURL = [] const [toReadURL, setToReadURL] = useState([]) useEffect(() => { const listReference = sReference(storage, parameterKey) // Retrieve all the prefixes and items. listAll(listReference) .then((res ...

What might be causing the sluggish performance of AzureDevOps private NPM repository with node versions 14 and 16?

After upgrading NodeJs to version 14 (and also tried with version 16) on my MacOs using NVM, I deleted the package-lock.json and node_modules directory. When running npm i -verbose, I noticed that the installation process became extremely slow. For each pa ...

Solve the mystery of hidden IP addresses in Node.js with the help of the DNS module

Is it possible to achieve the same result as running the command dns-sd -q a5b3ef18-2e66-4e24-91d2-893b93bbc1c1.local on Mac OSX using Node.js? It appears that the dns module in Node.js is primarily used for converting website addresses to IP addresses, no ...

Utilize npm to compile TypeScript files as part of the npm build script execution

I am in the process of creating a build script using only npm, without relying on grunt or gulp. Most aspects are functioning well except for concatenating typescript files. While I can compile individual typescript files successfully, I am faced with th ...

The challenges of dealing with duplicate identifiers caused by nesting npm packages in TypeScript

I am facing an issue with my project structure where I have a node_modules folder at the root level and another one within a subfolder named functions. The directory layout looks like this, ├── functions │   ├── index.js │   ├── ...

Using "type": "module" in your "package.json" does not seem to be functioning

Whenever I type in "npm start" on my terminal, I encounter the following error message: (node:1079) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. /Users/sangkuoh/Desktop/Udacity_FEND_TravelApp-master/sr ...

"Experience the seamless navigation features of React Navigation V6 in conjunction with

Hello there, I've been experimenting with react-navigation 6 in an attempt to show a modal with presentation: "modal" as instructed on the documentation. However, I'm facing an issue where the modal is not displaying correctly and appears like a ...

Error: globalThis has not been defined

I recently added the aws-amplify/cli npm module globally using the code below: npm install -g @aws-amplify/cli The installation was successful, however, when I tried to set up my environment with amplify cli, I encountered this error message: /usr/local/l ...

Encountering a console error: Prop type validation failed for the `Rating` component with the message that the prop `value` is required but is currently `undefined`

I am encountering a proptype error which is causing an issue with the URL display on my Chrome browser. Instead of showing a proper address, I am seeing the URL as undefined like this: http://localhost:3000/order/undefined Instead of undefined, I should h ...

Global installation of Node modules

How do I reference globally installed node modules? For example, if I have a package.json file and I choose to install all the node modules listed in it globally (located at C:\Users\MyaccountName\AppData\Roaming\npm), how can I ac ...

An error occurred while checking the Node.js npm version in internal/modules/cjs/loader.js at line 892

In Node.js, I am encountering an error while checking the npm version. The error message is as follows: internal/modules/cjs/loader.js:892 throw err # below error occurs npm -v https://i.stack.imgur.com/UouXf.jpg # below error occurs npm -v readline-sy ...

React: Material UI causing an error due to an invalid hook call

Working on a React project using create-react-app with material UI, encountering errors like: https://i.stack.imgur.com/mhjkE.png Appears to be an internal issue with material UI once setting a custom theme. import { ThemeProvider } from "@mui/material/ ...

I am completely lost and have no idea what is happening

Every time I download some React code from GitHub to check for inspiration and run it using npm start, I encounter this error message in the terminal. What steps should I take next? sh: react-scripts: command not found npm ERR! code ELIFECYCLE npm ERR! sy ...

Tips for extracting data from nested JSON structures

I'm trying to retrieve the username of a user from the Firebase Realtime Database, which is stored in a UsersList. I have attempted various methods as shown in the code snippets below: https://i.stack.imgur.com/GsovS.png However, no matter what I tr ...

Utilizing React components from npm in Rails: A comprehensive guide

Recently delving into the world of react, I came across an insightful article on integrating React with Rails at . The transition was seamless until I attempted to incorporate Summernote (a WYSIWYG html editor) into my records.html page. Despite discoverin ...

Uh oh, something went wrong! The error code is: Oops! Module version doesn't match. Expected 48, received 64

An issue has occurred. Error message: Error: Module version mismatch. Expected 48, got 64. Stack trace: Error: Module version mismatch. Expected 48, got 64 18-09-27 09:27:32: (node:25120) DeprecationWarning: current URL string parser is deprecated and wil ...