I'm trying to start a new react environment using npx command.
While the npx is working and the directory is formed, when I try to start it won't work (using npm start).
This is the error I'm getting:
Here's a snapshot of the error I'm receiving:
Any idea what I need to do?
I've tried to re-install node.js to its latest version and try to change minor things in the package.js file.
Related
When intially installing a npx create-next-app#latest or npx create-next-app#latest --typescript complete the install and then try running with next dev I see a useContext error.
I haven't touched any files and am just trying to run bare bones but yet I'm seeing this error, I even search for useContext in vs code search and nothing is found.
Wondering if I'm the only one who is experiencing this.
i run cmd npx create-next-app#latest --ts is all right,i guess y maybe at that time network is bad
enter image description here
For some reason when trying to create a new app using create react app, it results in errors everytime. Anybody know what's going on?
Error Stack
Have you tried it without the additional --use-npm flags at the end?
npx create-react-app user-onboarding
cd user-onboarding
npm start
Official docs
Edit: Yeah, reading your errors in the screenshot it appears that the --use-npm flag is causing it to use npm which has outdated versions available, but npx always finds the newest versions. Which is a big reason it is the preferred method for installing create-react-app
If you have your heart set on using npm you can always do an npm update before running it again.
I am trying to setup React environment and I am getting two errors when running npm start in command prompt.
First error is "module build failed (from ./node_modules/babel-loader/lib/index.js)" and second is
"error plugin/preset files are not allowed to export objects only functions".
Any idea how this could be solved? I am new to this whole thing so please try to keep answer simple and steps easy to follow.
change your directory and install your app again via this code :
npx create-react-app yourAppName
then install all dependencies
Whenever i create a react app using create-react-app and run npm run start it crashes.
This is the error i am getting in terminal.
Failed to compile ../node_modules/react-dev-utils/webpackHotDevClient.js
Error: [BABEL]/Users/toures/Desktop/REACT/SecondSummit/try1/node_modules/react-dev-utils/webpackHotDevClient.js:
Cannot find module './src/data'
(While processing: "/Users/toures/Desktop/REACT/SecondSummit/try1/node_modules/babel-preset-react-app/dependencies.js$0$9")
Can anyone guide me? Thanks.
In the past I've fixed it by deleting the node_modules folder, then running npm install.
I created a new app using create-react-app with the --typescript flag. This generates the file App.tsx. When I open this file in VS Code I get lots of "problems" identified before I even change any of the generated code. The first error is on the "div" tag returned by the render method. It says "Cannot find name 'div'". Running tslint doesn't output any errors. Is there some configuration I need to do in VS Code to remove these problems?
You can try with this command with npm:
npx create-react-app --scripts-version=react-scripts-ts
npx comes with npm 5.2+ and higher, so if your npm version is below 5.2 you should update it