React npm start issue - node.js latest version - javascript

I have installed the latest version of node.js and tried to create my very first react application.The applications gets created fine.but when i navigate to the application and try to use the command npm start,it throws an error.I have tried to remove the npm_modules,update npm,npm install create-react-app command.Still the problem persists.Any idea or suggestion will be very helpful!Thanks in advance!

Well the issue is resolved..i just had to set my path variable to c:\windows\system32
using the command PATH=%PATH%;c:\windows\system32!Thanks for all those who tried to help me!

If you use CRA, it is recommended to use npx instead of npm.
npx create-react-app myapp

Related

Terminal stops running commands after switching Node's version with nvm

Hope to find you guys well =).
So, my problem is that I'm trying to initialize a Gatsby project and after some trouble I discovered that for some boiler plate "starter" template to work I would have to install an older version of Node. Since I already have nvm installed, I just downloaded the version I wanted and switched via terminal.
I verified it with node -v and it threw me the version I wanted. The thing is that when I try to run 'gatsby develop' it says "gatsby: command not found".
And that if I close and open my terminal again it resets the version. Is this supposed to behave like that?
By the way, you can already tell that I'm new at this so any information or guidelines will be of extreme helpfulness.
You can try doing yarn develop if using yarn. Or npx develop if using npx

Create React App with an older version of node

I am trying to use Create React App but getting an error that it requires Node 10 or higher. My node version is Node 8.10.0 and there's no way for me to update the Node version since it's a work machine. Is there any way to run an older version of Create React App to work with my older Node version?
I managed to run it. It seems like the last versions of the packages which support Node 8.x.x are 3.4.1 for create-react-app and 3.1.1 for react-scripts. What I did:
npm uninstall -g create-react-app
npm install -g create-react-app#3.4.1
create-react-app my-app --scripts-version 3.1.1
But it's better to update your Node version to the actual (or LTS at least).
From my understanding you can add the flag --scripts-version to your npx create-react-app command. So for example if you wanted to run react version 15.6 you would run something like:
npx create-react-app appname --scripts-version 1.0.14
You can reference the react-script repo as well as the NPM Package for more information on which version of the script you would want to run. Hopefully this helped! If not please let me know and I'm more than willing to try and look more into it.
Edit:
Forgot to mention that you need to make sure to change the versions of react and react dom within your package.json after. So after installing you would run:
npm i react#15.6
npm i react-dom#15.6

React Storybook blank page when run

I am trying to load the demo storybook stories.
I created a react app using create-react-app and run npm start. It starts on port: 3000.
Then when I run npm run storybook, it opens a browser on port:6006. But displays a blank page only.
What helped me was to run
rm yarn.lock
yarn install
after installing storybook into my project
Apparently react has upgraded to version 17.0.0, but storybook hasn't made the switch yet.
If you take version 16.14.0 of react it should work.
https://www.youtube.com/watch?v=fjb_QcQhRrs
If you wanna stay on react version 17 then you could upgrade storybook to prelease by doing
npx sb#next upgrade --prerelease
for additional information please refer GitHub issue #12408
Try to clear your browser cache. It resolved my issue.
npm ci saved the day for me and fixed the issue
My problem was because I updated #storybook/preset-create-react-app too and it seems I shouldn't have.
When #storybook/preset-create-react-app was reverted back to initial version 3.2.0 in my case, and #storybook/react updated to latest ^6.5.4 - everything was fine.

Laravel Vue.js application not running

I have a serious problem on running Laravel + Vue.js new applications. I tried that on a 50% developed app and also on a brand new Laravel instalation and that shows the same error. After installing the Laravel and going into php artisan serve i start a common routine to start Vue.js within that Laravel application, which means NPM RUN INSTALL and right after NPM RUN DEV. This is what the errors show me:
I have tried all possible solutions found on previous posts on Stack Overflow and Github but the error persists. I have a node version 10.15.1 and the latest Laravel scaffold. Any thoughts on what might be happening? Im at the point of giving up using a scaffold Vue.js and instead using it as stand alone.
Thank you!
It seems like, It fails while vue-template-compiler package getting install through yarn.
It might be issue with yarn in your system.
Try to first install vue-template-compiler through NPM:
npm install vue-template-compiler
Then try again with npm run dev.
I hope this will help.

IntelliJ Idea React-native not working properly

I have recently installed intellij idea on my PC and started react-native application. I installed all libraries required for react native and react js. Also installed node js module and all plugins for this ide. Still i am getting error below like this in import statement.
When i move to that line that shows me error like.
-> Install TypeScript definition for better type information.
But my typeScript definition are also as per required.
Also I have changed my JS to ReactJSX.
I have attached image over here for reference.
You should try to create a new project using following commands
npm install -g create-react-app
create-react-app my-app
cd my-app
npm start
If you still facing error then try to use vscode editor and select react language. If you still face issue let me know

Categories

Resources