I've been trying to post my web app on Github pages but while building the app using the npm run deploy command this error keeps on popping. I'm new to react and can't seem to find what the problem is.the git path is added in env variables. I'm on windows. this is the snapshot of the error.
the deploy script
Try using npm run build and follow the instructions, after that a new folder will be created inside the root folder of your project, and that folder is a compression of your project, and the one you need to deploy on Github.
Related
I was trying to deploy my MERN based E-commerce website on render.com, after the render terminal shows the build was successful the the webpage shows the error as,
{“message”:“ENOENT: no such file or directory, stat ‘/opt/render/project/src/frontend/build/index.html’”,“stack”:null}
I’m a complete beginner to render and MERN too,
I have no bulid folder in my local
then I tried to create another test app by npx create-react-app test to check if build folder is actually present in there or not, But it is not there, I’m totally in Confused now…
I’m Giving my repo here → stunning spark
I just want to have clear answers for my questions(Please!!!)
Things I want to change in my directory to deploy and host my app Successfully.
Things Need to be configured in the render’s settings
Thanks in Advance!!!
I just want to deploy and host my application on render.com
Just run npm run build into your frontend folder and do check you have removed the "build" keyword from the .gitignore file because it won't let you push the build folder to GitHub and you are good to go.
I have a Node app that is running on heroku.
Now I want to make some changes to the package react-window that I'm using (the first time that I'm trying this)
So I forked the react-window repo and replaced the original packgage using:
yarn remove react-window
yarn add https://github.com/myusername/react-window.git
When I build this on my local machine, everything is fine and the forked packages is used.
But when I try to deploy it on heroku the build fails and I get this error:
error https://registry.yarnpkg.com/#babel/runtime/-/runtime-7.0.0.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, chmod '/tmp/yarncache.wxh1C/v4/npm-#babel-runtime-7.0.0-adeb78fedfc855aa05bc041640f3f6f98e85424c/node_modules/#babel/runtime/helpers/asyncIterator.js'"
I tried to point to a specific branch, but this also does not work:
yarn add https://github.com/myusername/react-window.git#master
When I reinstall the original package, everything is fine again.
So my question: what is the right way to add a forked package when deploying to heroku?
Currently I made a simple app with react, it works perfectly and I use react-scripts. I installed React by following the Facebook github page, and it written that "When you're ready to deploy to production, running npm run build will create an optimized build of your app in the build folder. ". After I press npm run build, a folder build created, but I do not know what to do with this folder. I tried some method like, move all folders except build and npm run, but it did not work. Anyone can explain me what is this folder "build" ? Thank you
npm run build builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
npm run build creates a build directory with a production build of your app. Set up your favourite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main..js are served with the contents of the /static/js/main..js file.
I am attempting to set up a xcode project and bot that will build a nodejs application on commit from a github repository and restart the server after the build completes. The bot is currently picking up on the repository changes but fails to build correctly.
I am using a xcode external build tool project that uses /bin/bash as the tool path and the working directory is set to the local repository path.
The bot's after integration script is something like,
npm install --production
npm run build
npm run server:restart
I am getting errors like [npm|node] is not recognized.
Just looking for some clarity to what I might be missing or what could be going wrong.
Add this to the beginning of your script and review the output:
which node
set | grep PATH
This will happen if node is not in your path, which may happen because build scripts have a pretty basic environment - they're not running as a normal user. You may need to add it to your PATH at the start of your build script.
The problem was with git add.I had forgotten to add the node_modules files.I closed the terminal and ran the set of commands given in the Getting started with Heroku and NodeJs[1] again.The application was successfully pushed onto the stack.
Heroku will automatically detect a nodejs application if you include a package.json file in the root of your project. Ensure that package.json is added to your git project before pushing your project to Heroku.
Your nodejs application should be managed with NPM. For a complete working example see the Nodejs guide on Heroku:
https://devcenter.heroku.com/articles/nodejs