I installed node, then I ran npm install create-react-app, then ran npx create-react-app hello-world.
The last command did not go through because of some package funding, whatever that means.
How do I fix this?
I am using windows. Here is how my command prompt looks like:
When you do "npm install create-react-app" you're installing in the current folder a CLI to ease up creating a React template for your projects. Doing "npx create-react-app hello-world" is redundant as you've already downloaded the create-react-app module, if you do not wish to save the CLI software and only create the template then it's a better approach.
Using the "-g" flag will allow you to use the CLI globally to create React projects on your computer ("npm install -g create-react-app" this might require certain permissions) instead of only the specific folder you're on.
Once you're done you must use the command "create-react-app 'your_project_name'" to use create-react-app to create your project. More information here https://reactjs.org/docs/create-a-new-react-app.html#create-react-app, to start the project just head inside the created folder and do "npm start".
Packages looking for funding is exactly what it says, the developers of these modules are looking for funding.
Uninstalling x64 version of node and install x34 version solved my same issue.
Related
I recently switched to Ubuntu, whenever I create react app it's giving me this note, and the app it's creating is a class component.
ankit#gram:~/Documents/Development/React/react-project$ npx create-react-app my-app
Creating a new React app in /home/ankit/Documents/Development/React/react-project/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
added 987 packages in 39s
22 packages are looking for funding
run `npm fund` for details
Success! Created my-app at /home/ankit/Documents/Development/React/react-project/my-app
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-app
npm start
Happy hacking!
Note: the project was bootstrapped with an old unsupported version of tools.
Please update to Node >=14 and npm >=6 to get supported tools in new projects.
my node version: v16.14.0
my npm version:8.3.1
I think this was because npx was not installed in my system, when I created a react app by this command create-react-app the app created was fine. I also installed npx using this command npm install -g npx and created a react app and everything was fine. before this make sure you have installed create-react-app in your system if not then install it by using this command
sudo npm install -g create-react-app
I am a new programmer had this issue not long ago I just solved it.
Use sudo apt install nodejs
It will automatically install version 10 for you which doesn't accept React.
Then you try to install NVM package, use it to update your node to a newer version.
You can check me on GitHub bari racha Wuye
I was having the same problem after I had just installed Ubuntu 22.04.
The fix for me was updating node and npm by following these instructions free code camp update node and npm
Specifically, I followed the instructions under the heading "1. Use NPM to Update Your Node Version", to update node and ignored the 2nd and 3rd headings, then followed the instructions under the last heading to update npm
afterwards I restarted my computer, opened the project directory and ran the command
npm i create-react-app#latest
then I ran
npx create-react-app projectname
and it worked as expected
I'm starting a new react app using the
npx create-react-app <app name>
and am recieving an error of a template was not provided do the following ->
npx uninstall -g create-react-app
Well, I have done it and it hasn't helped. I've tried updating the current nodejs and npm versions, I've done a fresh install of nodejs, and I've cleared the npm and npx caches. I've also tried using specific create-react-app versions such as
npx create-react-app#latest(or some other version)
Nothing works, no template is ever provided, and I'm a little lost. Does anyone know another potential workaround? I'm open to manually downloading a folder containing the npx create-react-app post-completion contents if such a thing exists.
The React docs point out that you may have create-react-app installed via Yarn instead of NPM, and can try this also:
yarn global remove create-react-app
This SO answer suggests that if the npm uninstall -g create-react-app doesn't work, you can manually look to see if and where create-react-app may be installed.
If npm uninstall -g create-react-app stated above does not work. Type which create-react-app to know where it is installed. Mine was installed in /usr/bin folder. Then do sudo rm -rf /usr/bin/create-react-app.
Are you on Windows or Mac/Linux? The which command works on Mac/Linux, but not on Windows. I don't know the best way to do this on Windows, but this thread has some suggestions for PowerShell.
My understanding of the npx command is that it psuedo-installs the package (in this case, create-react-app) to ensure that we're using the latest available. It's convenient and recommended, but it isn't required. If you continue having issues, I would personally try fully installing create-react-app to see if I can scaffold a new project that way:
npm install -g create-react-app
create-react-app my-app
I know npx create-react-app and npx-next-app what are all others app npx support?
npx is a program that downloads any package on npm. create-react-app isn't a command for npx, rather, you're telling npx:
Download react-create-app
Cache it (but not in the current directory, so it will stay 'clean')
Try to run it as a program (the package.json file says how to do that, in this case: "run node ./index.js")
npx knows nothing of React or Next.js and it doesn't have these things built in. All it knows is about is npm and how to run any (executable) package it downloads from there, like npx gulp or npx serve.
If you're working with a new framework and you're wondering if there's a utility to quickly set up a project, just search NPM and see what pops up.
There is no set list because npx is a package runner for Node.js. Running npx create-react-app will try to find the package create-react-app and run it. The package will be downloaded if not locally installed.
Therefore, the list of supported commands for npx is "everything included in the repositories used by NPM". You can even create your own package, not visible to anybody else, and run it with npx.
I use CRA approach (create-react-app) using npm install installed different packages for my project, I don't use many of them but manually check which of these packages is not used on the project and then remove it will be a very difficult process, is there a way quickly check which packages are not used on my project and remove them?
You can check for any unused dependency or devdependency with depcheck package in any nodejs project. Use npx to use this package without installing it, run following command in terminal:
npx depcheck
I'm starting work on React Native, using create-reactive-native-app and Exponent. There is a nice list of open source examples here, some of then are mentioned to use Exponent.
https://github.com/ReactNativeNews/React-Native-Apps
I have few experience with nodejs. I already noticed there are several possible configurations for React Native apps. I usually use npm start to run it, but that don't work on those examples, since since they don't have a start script in package.json.
Take as an example the native-component-list app. How can I execute it after cloning and doing npm install?
Using node v6.11.4 and npm 3.10.10
I also tried using react-native run-android . It works when I create a new project with react-native init Ola2
But not with the downloaded code.
Here are some more details. I did this before: npm install -g react-native-cli
npm install
react-native run-android
Scanning folders for symlinks in xxx/native-component-list/node_modules (25ms)
Android project not found. Maybe run react-native android first?
react-native android
Scanning folders for symlinks in xxx/native-component-list/node_modules (26ms)
Unrecognized command 'android'
Run react-native --help to see list of all available commands
As per this link, you can run the app with command react-native run-android (for android)
I found the problem. I just had never used Expo.io way to create a ReactNative app. I only knew the init and the crna ways. This apps where created with the exp tool.
So,to run it, just do:
npm install exp --global
npm install
exp android
exp start
I didn't work on Expo, I prefer react-native-cli
In your case, your project in developed on Expo.
So you need expo-cli to run the project.
For Expo Cli
npm install -g expo-cli
For CRNA
npm i -g create-react-native-app
Internally CRNA use EXPO, so you can choose any option. After installing the expo-cli npm start command work fine for you.
Or you can eject this project.
You can run npm run eject to get a project very similar to what react-native init would generate. At that point you’ll need Xcode and/or Android Studio just as you would if you started with react-native init , adding libraries with react-native link will work, and you’ll have full control over the native code compilation process.
Hope it will work for you.