nodemon doesnt start the server file after restarting due to changes - javascript

It is said that pictures speak louder than words so...
As you can see nodemon works just fine by itself as expected:
then when i get express to the project nodemon just keeps restarting due to changes
tried pretty much every solution i can find on the internet(including here on stack) for this problem nothing worked...
Can someone please tell me what's the problem and how to fix it?

I've met the same error in the past and you can try these following ways:
Solution 1: Uninstall your nodemon and install it again by executing
npm uninstall -g nodemon
then
npm install -g nodemon
Solution 2: Your computer maybe lack of environment. Add this
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\wbem;
into %PATH% environment variable which located in
Control Panel\System and Security\System
then move to
-> Advanced Settings System -> Environment Variables...
and reset your computer.
I hope these solutions work.

Related

ElectronJS npm start / bash: electron-forge: command not found

My System:
Mac OSX 10.14.6
Electron: 10.1.5
electron-forge: ^6.0.0-beta.54
I've been working on an Electron side project. I started it using electron-forge, I had a small application functioning just fine, I then set it aside for a couple weeks. Coming back to it, I tried running npm start and it did nothing but return to a new terminal line. So I tried electron-forge start and it returned bash: electron-forge: command not found.
I tried deleting my node_modules folder and reinstalling, I tried creating a new electron-forge boilerplate, and neither made a difference. I tried installing electron-forge globally, but it errored out on the second step, and I found several stackoverflow articles saying I shouldn't have electron-forge installed globally. I haven't changed anything (that I know of) on a system level, but it seems to be a system issue, rather than a package issue, but I'm not knowledgable enough to do anything other than Google the errors and see what stacksoverflow articles are out there, but no articles have helped.
I'd love any and all help, Electron has ceased working on my system completely, and I have no idea how to troubleshoot it. Thanks in advance!
I ended up deleting and re-installing Node and that seems to have fixed it. Still not sure what caused the initial issue, but it's working again. For those interested, here's the resources I used:
https://stackabuse.com/how-to-uninstall-node-js-from-mac-osx/
https://pawelgrzybek.com/install-nodejs-installer-vs-homebrew-vs-nvm/
Update:
I kept having issues running npm start. What finally worked was to create a new boilerplate project using the CLI and copy the contents of the package-lock.json to the old project. That finally launched the app.
I know this is an old question but, I had the same issue and instead of uninstalling Node, I used rm -rf node_modules then I used npm cache clean --force. I reinstalled my dependencies and electron-forge worked again.
Use the command below
npm install electron

npx create-nuxt-app <project-name> not working

I want to create Nuxt.Js app using npx. But i am getting following error.
You have a space in your Windows username. This is a problem with NPX.
This is the path that NPM sees (which is right)
This is the path that NPX sees (which is wrong)
You can fix it by changing your NPM-Cache to another directory (without a space in the path):
npm config set cache C:\your\new\path\npm-cache --global
Source:
https://github.com/zkat/npx/issues/146#issuecomment-384016791
I changed npm-cache directory by writing following command
npm config set cache C:\tmp\nodejs\npm-cache --global
After that npx create-nuxt-app <project-name> worked perfectly.
I had it working using this command.
npm init nuxt-app <project-name>
This problem was resolved in a reddit
https://www.reddit.com/r/vuejs/comments/ie8vab/createnuxtapp_not_working_anyone_else_had_this/
Install it with:
npm i -g create-nuxt-app
Usually npm/npx should propose you to install, but it might not work
This issue can appear if during first try the installation was aborted
I have encountered similar problem and I have multiple spaces in the username.
If the above solutions does not work for you on Windows, there is another way.
Run VS code editor as an administrator.
Open the integrated terminal by clicking on Terminal > New Terminal or by pressing CTRL + SHIFT + '
Instead of using npx use the following
npm init nuxt-app project-name
Point number 3 will only work if you run the VS code editor as Administrator.
I am sure it is the same with external terminals. Run CMD/Gitbash as Administrator
Hope this helps. :D

Nodemon issue, stays hanging

I use currently the following:
windows 10
NodeJS: v10.9.0
npm : 6.2.0
nodemon: 1.18.3
And have the following issue, when I press control s after changing something in my files nodemon will hang. It will not update the server and when I press control s multiple times it shows the following:
What could possibly causing this and how can I potentially fix this?
I tried reinstalling different versions of nodmeon, and reinstalling nodeJS (different versions).
You might have to use the legacy flag nodemon -L when running it.

GitKraken pre-commit fails but works in command line commit

I'm trying to commit any kind of change to a branch in my repository using GitKraken and get the following error every time:
whats strange is if I run git commit -m 'test' it commits without any errors. If I comment out the below line in my package.json then I can make commits in GitKraken no problem:
"precommit": "yarn check --integrity && lint-staged",
The person i've inherited the project from uses an Apple machine and he isn't experiencing any issues like this so not sure if that could be related. I'm also using node v8.9.4 and yarn v1.5.1
I've also tried deleting the yarn lock & node modules folder but still the same result. Anyone have an idea what might be going on here?
Check this issue, might be the answer, it has to do with the shell GitKraken uses by default in Windows:
https://github.com/typicode/husky/issues/243

bash: nodemon command not found windows 10

I spent a lot of time looking for a solution, but didn't find anything (with my case) So...
I checked global packages npm list -g --depth=0 and got
But when I went to the folder C:\Users\Sergey\AppData\Roaming\npm\node_modules, there was no nodemon
I know this question has already existed. Please, help me anyone...
I found a solution (in my case).
All you need is to add C:\Users\Sergey\AppData\Roaming\npm and C:\usr\local (of course with your file paths npm and local) to System variables (Control Panel\System and Security\System\Advanced system settings).
And after that restart your PC
Have you tried re-installing nodemon?
npm i -g nodemon#latest
If that too does not work, try installing nodemon in your project, dont't save it as dependency though.
Also you may to remove node folder and install nodeJS again

Categories