npm build run package (react) terminal command - reactjs

How to update "build" folder of a project after changes or updates?
I tried npm update but can't update the build folder while I made changes of my project

I usually use npm run build command for building it again. It overrides the previous one.

Related

Error while install MD Bootsrap 5 in my react js

When I want to install a plugin in react js using MD Bootstrap 5 then it gives me an error. I have done with installing mdb-react-ui-kit in my package.json file.
You are mixing git commands with npm. git is a source control software while npm is a package manager for node.
If you want to clone a project you can run:
git clone <repo_address>
If you want to install an npm package, you need to be inside the project folder that you want to install, make sure that there is a package.json file and run:
npm i mdb-react-ui-kit

Installing local npm project as a dependency

I'm trying to use a local install of my npm package. The npm package is a React component library, and instead of upping the version and publishing to npmjs I would like to just use the local version in my application project.
Now I found the following command: npm install {path to folder}, and when I do that I get the entire project installed and my components don't work. When I install using the local folder I get the entire project in my node_modules:
And when I publish via the NPM registry I see this:
I think that's the issue, but I'm not sure how to fix it. The path I'm using is just to the root of the NPM project, so not the dist folder, but I also need the package.json for so pointing to just the /dist doesn't work I think.
Any pointers would be appreciated :)

React Native Project not able to run

I am new in React Native and trying to run the project for the first time. Whenever I try to run it it shows the error at the cmd console as
I also tried uninstalling the previous version of node and installed it again and it still shows the same problem. checked out some of the solutions and didn't work.
I'm using node and npm as in the following image.
try installing you node_modules after removing the old ones:
I suggest doing these three steps:
1- npm install -g npm#latest to update npm because it is sometimes buggy.
2- rm -rf node_modules/ to remove the existing modules.
3- npm install to re-install the project dependencies.

Why is it necessary to run 'npm install' when I already have all the dependence in node_module folder

Why is it necessary to run 'npm install' when I already have all the dependence in node_module folder.
After running 'npm install' successfully on my machine, I want to setup same project on another machine, why do I require run 'npm install' again when I already have downloaded all the dependence in node_module folder?
First of all I want to inform you 2 things:
As your project depend on some packages (node_modules), same as some packages are dependent on other packages.
when we install some package with command npm install package -g then -g will install it in global folder which can be accessed by any project. by using -g, package is not added to node_modules.
Now here is answer of your problem. There might be possible that some dependencies of packages are installed as global on one machine and not on other one. This can happen as developers work on many project on same machine and might be they have installed global packages. So in this case you need to execute npm install command.
npm install extract all your dependencies from your package.json, download it and save them in your node_modules folder. You don't need to run npm install again and again if you already have installed all your dependencies locally.
When ever you installs a new dependency you run npm install <package-name> --save and why --save for the first time? because it adds the new installed dependency on your package.json. We never push node_modules to our git repo only the updated package.json is pushed to repo. In that case if a new person pulls your code from the repo he is only going to run npm install and all the dependencies mentioned on your package.json will going to available on his project locally. Thats a small intro about why we use package.json hope it helps.
Check the version of node in both system .
I guess that would be issue. you local system would have either higher version than the server. May be not able to compile for higher version make sure the version are same for node in both , to reduce the comflict.

Npm run build not creating build folder

I have a react application, and in the past I have successfully deployed it to surge.sh by running npm run build and then running the surge command from inside the build folder. I made one small change to the scss file, and now when I run npm run build, there is no build folder being created so I can't deploy the app. Does anyone know what could be going on?

Resources