react doesn't allows to edit in node_modules folder? - node.js

I tried to run npm start on the terminal but this error including with many errors came in the terminal.
i 「wdm」: wait until bundle finished: /
C:\adrosonics_main\KM\km_admin_portal_revamping (3)\km_admin_portal_revamping\node_modules\loader-runner\lib\LoaderRunner.js:133
I expect to start the server.

Please follow these steps.
Delete the node modules
Run npm cache clean
Run npm install
Lastly npm start

Related

Why does my Next.JS edit code work (on npm run start)? without new build (on npm run build)

Why does my Next.JS edit code work (on npm run start)? without new build (on npm run build). I wonder why it is so. Or did I do something wrong?
In nextjs .. if you want to run development server, you have to run
npm run dev
npm run start --> Runs your production build.
Please check your scripts in package.json

Bus Error when running npm run dev || npm start

I can't seem to run npm run dev or npm start on my macOS machine.
I get a bus error message every time I try to do so, and the output is usually something like this:
klvn git:(main) ✗ npm run dev
> klvn#0.1.0 dev
> next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[1] 1736 bus error npm run dev
➜ klvn git:(main) ✗
I've tried removing the /node_modules, package-lock.json and /.next folders but that doesn't seem to help.
I'm running macOS Monterey.
The issues actually with node_modules and the package-lock.json file. Delete the following first:
delete node_modules directory
delete the package-lock.json file
And then run:
npm install
npm run dev
or any other npm command.
I had this same error with a project I cloned from a repo.
My solution was to delete the local version of it and then clone it again. Then run an npm install and then the npm run dev script again.

npm run watch fails to run, but gives no error

I am working on a project with a couple of others using laravel and react/material ui.
Something happened to my npm (someone tried to fix it and ran npm audit fix --force) and therefore I needed to reinstall it. I deleted npm, deleted node js, reinstalled node js and ran npm install.
I have tried countless things so far, including things like remove node modules and package-lock.json and using rm node_modules and rm package-lock.json followed by npm cache clear --force.
When I run something like npm run watch or npm run dev this is the output I get.
> watch
> npm run development -- --watch
> development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
After that I expect it to compile and stuff but instead I see the line
SP C:\xampp\htdocs\projectName
I have tried it with xampp running and without xampp, I also tried it from the phpstorm terminal and the cmd (with admin rights) but sadly nothing seems to work.
The only solution I could find in the end was reïnstalling Windows. There probably was something like a node or npm folder left somewhere that was interfering with the rest.
In my case, another npm run watch was running in background from another launch
killing it solved

Run 2 npm commands at once

I made a MERN project, and my structure is one backend folder and one frontend folder.
So, every time I work on it I have to cd to backend, run npm start, then in another tab, go to frontend and run npm start.
Is it possible to do a npm init in the root folder, and create a npm start that will run both commands at once ?
I'm new to terminal.
Thanks !
There are several ways you can do :
1- You can use concurrently(npm install -g concurrently)
---> concurrently "command1 arg" "command2 arg"
the most developer use these ways.And i know just these ways.
You can use this command in your terminal :
node frontend/index.js & node backend/index.js
or
npm start --prefix frontend/ & npm start --prefix backend/
You may have different paths to your files

'npm EER! code 1' When installing dependencies using `npm install --production`

I am using flightplan to deploy my node.js application to my server. I run the command fly production in my CLI to deploy my app to the server. It does rsync fine, but when it comes to installing dependencies, I get the following error:
I made sure that I have sudo privileges on my server for this user and npm is definitely installed as it gives the version number when I run the command npm -von my server. I have tried to run npm install --production myself on the server as the deploy script does and I get the same error, meaning it is something to do with installing dependencies. Potentially, it could be because in my flightplan.js, when it runs the command git ls-files to get the files to copy across. it includes all the node_modules even though i've made sure that node_modules is in the .gitingore file.
Does anyone have experience with flightplan npm module/or know why my npm install isn't working on my server?
(I edited out my server IP address from the picture)
Thanks in advance!
I found that if I removed the node_modules folder by running command rm -rf node_modules/ then committed this to github, then re-ran npm install and then my call to fly production worked successfully.

Resources