Can't deploy my app to github-pages with react-create-app - reactjs

I've recently finished building my app, using react-create-app, but I can't load it on github pages. It builds a production version without any problems, but whenever I enter "npm run deploy" into the console I get the following error:
Error: spawn git ENOENT
at exports._errnoException (util.js:1033:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
at bootstrap_node.js:540:3
I'll leave a link to my package.json since I can't seem to make it look neat here: https://github.com/Umbrella1234/movie-app/blob/master/package.json
Do you have any ideas how to make it work?

If you are using Windows, make sure you have installed Git for Windows from here.
Considering you have taken the previous steps correctly, after installing Git for Windows, running npm run deploy creates an optimized production build and deploy it on GitHub pages. If you haven't logged in to Github for windows app before, Github app pops up and asks you to enter your username and password. When you've done that the deploy process will continue and uploads the production build on GitHub pages.

Sometimes Windows Powershell or even 3rd-Party software have trouble integrating with git.
One solution is to use Git Bash or whichever tool you know has works when trying to make commits. Navigate to the app directory using cd and then type npm run deploy inside of git bash. This should be able to connect to github no problem and fix your error.

Related

whenever I try to run my project I keep getting the development server returned http response code 500 for url in react native

this problem occurred after deploying sanity to my project(I don't know if its the source of the problem but just wanted to share it.)
[This is what I see in the emulator]
(https://i.stack.imgur.com/otbGz.png)
and the following is what appears in the terminal:
Error: Duplicated files or mocks. Please check the console for more info
at setModule (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro-file-map/src/index.js:553:17)
at workerReply (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro-file-map/src/index.js:624:9)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 27260)
at /home/faisalmwy/development/react-native/food-delivery/node_modules/metro-file-map/src/index.js:395:22
at DependencyGraph.ready (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro/src/node-haste/DependencyGraph.js:94:5)
at Bundler.ready (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro/src/Bundler.js:75:5)
at IncrementalBundler.ready (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro/src/IncrementalBundler.js:327:5)
at Server.ready (/home/faisalmwy/development/react-native/food-delivery/node_modules/metro/src/Server.js:1247:5)
I've searched for this problem before, some said delete the package-lock.json and node_modules, but it didn't work. others said reinstall npm all together. that didn't work also. I also tried running the app on a different localhost that usual, since sometimes me and a friend of mine connect in the same time.
Have you tried to stop the application and do the below process:
cd android and gradlew clean
remove node_modules and package-lock.json
run npm i
also remove application from simulator or from your device
rerun application

Azure pipeline "npm install" but package doesn't exist anymore

When building my project in Azure pipeline, there is a step that does npm install.
However one of the package it requires doesn't seem to exist anymore on NPM. What are my options now?
8412 error code E404
8413 error 404 Not Found - GET https://registry.npmjs.org/angular-appinsights/-/angular-appinsights-0.0.4.tgz
8414 error 404
8415 error 404 'angular-appinsights#0.0.4' is not in the npm registry.
8416 error 404 You should bug the author to publish it (or use the name yourself!)
Edit I have added this package privately to Azure Artifact feed, and all other NPM packages (not privately) as well, would this mean that if in the future someone removes there package from NPM I would still have the (artifact feed) as backup?
Caution: this might not be the best practice
I had a similar issue with some legacy app that was built upon the beta of Material UI. When putting the application on a CI/CD pipeline what we had to do was before launching npm install have a script move the node_modules folder to where the application was being built and then launch npm run build because in this case it was a React App (I'm guessing it is similar for Angular).
What I would suggest is that you have a copy of that package from the node_modules folder copied into a node_modules folder while deploying before running npm install because npm won't install packages it finds are already there.
Of course best practice would be to update that package but I'm guessing that is not up to you. If you could, I would suggest you ask the developers to review the dependencies or to tell you how they deploy that application locally because, from the little research I've done it seems to me that there other up-to-date packages available. They might have installed the newest package but forgotten to remove the old one and since they have never had to redeploy simply didn't stumble upon that error, other possibility is they're passing the node_modules folder around.

How to give next js app build to the client

I am new on Next JS, I have created a small application. It is using API calls and more features.
During development, Using the command as npm run build I am able to create .next folder as build and using npm run start I am able to run that build.
Now the client is asking for build, so what should I send to him? Either complete project and ask him to do the
npm run build and npm run start (which I don't think so)
or only the .next folder. But how he will run this build?
Open package.json in your editor and add the following export script to the file:
"export": "npm run build && next export -o _static"
run this code in the terminal:
npm run export
Open _static folder and there is all of your file.
Some possible ways of sharing your project:
You can easily build and host your project with services like vercel or netlify. Easy and quick. Check out the vercel CLI in particular.
Your client can clone the git repo, install all dependencies, run build, and run start. This'll start a production server. Check here: https://nextjs.org/docs/api-reference/cli#production. Bad idea if your client is not a dev.
You can build your project and send the output to your client, which he/she can then view by spinning up a server (python simpleHTTPServer, Mamp). Also a bad idea if your client is not a dev.
Long story short, host your project somewhere and send them a production URL.

npm run deploy failure when deploying React app to Github

Problem:
I am still very new to React and am trying to push my React app onto Github, but I keep running into an error when I deploy it on my console.
Set Up:
I am using Atom on a Windows 10 computer. I created my React app by using the commands, npx create-react-app jordon. I then followed the steps in this youtube tutorial. This is what my package.json looks like after following the tutorial:
I then went through the steps to initialize a github repository. However, after running npm run deploy, I come across an error:
I have tried to rerun the steps in the tutorial time after time, but either receive the same error, or an error that is resolved by uninstalling gh-pages from the folder but leads to the same error. At this point, I have not found any resources that would help me, since most people seem to have successfully ran the npm run deploy command. Any help would be much appreciated!

Need help deploying react application with netlify

Not familiar with how to use netlify. Im trying to deploy this app
https://github.com/Rshauneb/real-estate
my build command is:
npm run watch
but every time I try to deploy my site I keep getting this error.
"failed during stage 'building site'"
Any suggestions?
Mimic what Netlify is doing in the build using their build bot.
Clone your project into a clean directory from GitHub
npm install
npm run watch
If you do not get an error, you may have a global command or setting that does not get set on Netlify. Without more information, this is the only answer possible.
Here is the error I found when I did the above:
Problem #2
Watch is a command for local development, so you should not be using npm run watch as a build command on Netlify. You will need to run the command to build your site into a directory for deploy and use that directory for your "Deploy directory".

Resources