npm runs successfully but terminal process stopped (system limit) - laravel

I'm studying Vue js and when I try to run npm run watch it says that Build successfully but next for some reasons terminal process stops and I get an error like:
Error from chokidar (/var/www/html/rankUp/node_modules/axios): Error: ENOSPC: System limit for number of file watchers reached, watch '/var/www/html/rankUp/node_modules/axios'
In fact, it worked fine a few minute ago(I haven't any changes in code), but when I restart my PC and re run npm run watch I got that! By the way, I should say that noticed weird action by axios I was trying to handle api data with axios, next when I comment whole axios code, I saw that it still worked idk how? maybe that is a reason of that erros?
Does anyone have an idea? why it happend?

If you are facing this error once you are trying to execute npm start, it’s because of your max_user_watches was reached the maximum number. Simply you can increase the max_user_watches by running this command :
$ echo fs.inotify.max_user_watches=288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
And then you can run npm start again

Related

Laravel runs dev assets nonmatter what on production server after I ran npm run dev accidentally

I ran npm run dev on the server with Laravel 9 using Vite and Tailwind. Now when I run npm run build it is still trying to load the css and javascript files from a domain 127.0.0.1. I can not get it back to reading the manifest.json in the build folder and loading those files.
npm run build runs without any errors,
however the npm run dev was throwing errors and I killed the process and double cheked using ps aux, and pkill commands.
I am lost.
nvm, for some reason the command
pkill npm
does not work I had to use
kill -9 [process-id]
and it worked.

Cypress won't start, blank screen. Mac m1

I recently started getting this error where cypress only shows a blank screen and I can't seem to figure it out yet.
I've tried:
removing/reinstalling node_modules
running yarn
My cypress version in package.json:
"cypress": "^10.3.0",
When I run yarn cypress I get this message, and cypress opens with a blank screen:
objc[35990]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x222c25b50) and /Users/[username]/Library/Caches/Cypress/10.3.0/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10923d3c8). One of the two will be used. Which one is undefined.
I was able to get it running again, after clearing cypress cache.
npm uninstall -g cypress
npm i -g cypress#10.9
yarn cypress cache clear
yarn install
run with yarn cypress
https://docs.cypress.io/guides/references/troubleshooting#Clear-Cypress-cache

Error executing "npm run test" with cypress

I'm learning cypress, but I came across this error.
When running npm run test the cypress window open for a while, but a couple seconds later it close, then this error appears:
I already installed the lastest cypress version and it didn't work.
Try running cypress cache clear and then npm install cypress --save-dev again.
then try running it with ./node_modules/.bin/cypress open.
Can you try these steps:
Delete node_modules folder
Run npm install -D cypress
Run npx cypress open
SOLVED: The problem was admin permission. When the blank window opened for a while, I clicked on the windows and authorized it again as adm. It worked!
I had authorized as adm before, but I don't know why it was happening.
Thanks you all guys for trying to help me.

Cannot read property 'pm2_env' of undefined

I got Cannot read property 'pm2_env' of undefined error when I try to run React project by yarn dev.
I've tried deleting node_modules, updating pm2, re-installing and deleting cache of yarn etc.
This is how I solved it -
Run pm2 update. Make sure you have the updated version - npm install pm2#latest -g before running update
If that still doesn't work, your processes are most likely stuck. Get rid of the pm2 processes, restart it and it should work fine
ps -ef | grep pm2
kill -9 <PID_OF_PM2>

"npm install -g yo" on Windows 7

on the following setup
Windows 7 Enterprise edition.
MyNodeJsCommandPrompt>node --version
v4.1.1
MyNodeJsCommandPrompt>npm --version
3.5.0
When I run the following
npm install -g yo
I get errors of this type
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\MyCodeDirectory\npm\node_m
odules\yo\node_modules\update-notifier\node_modules\latest-version\node_modules\
package-json\node_modules\got\node_modules\read-all-stream\node_modules\pinkie-p
romise\node_modules\pinkie' -> 'C:\MyCodeDirectory\npm\node_modules\yo\node_modules\glob
by\node_modules\pinkie'
Can anyone help? Thanks.
Try to use :
npm cache clean
One time, it solved my problem.
This is what solved my problem.
I ran this once. Thanks to #Akram_Saouri
npm cache clean
However, that did not solve the problem by itself. After that I reran the command multiple times.
npm install -g yo
Every time I reran the command it kept throwing the same problem, but I noticed that it kept throwing the same problem for different files. And every time I ran it, it kept making some more progress but would stop on a different file, further down the installation process.
After multiple tries, it ran till the end with a bunch of WARNINGS but there was no ERROR at the end.
So, it was solved, with the steps mentioned below. But, truth be told, I am not sure exactly what solved the problem.
Thanks.

Resources