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>
Related
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.
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
I am trying to update the Heroku CLI, however, without success.
Current version of Heroku CLI is
heroku-cli/6.15.5-1f03166 (win32-x64) node-v9.3.0
When running
heroku update
I get the following error
C:\>heroku update
CLI is updating... !
! 'ELOCK': write lock exists: update
I didnt' find any solution to this problem so far as I am hesitating to just uninstall and re-install the Heroku CLI (all my configs are lost then).
I solved this problem by uninstalling heroku and installing via command line:
npm install -g heroku
So I got the most current version.
Updating heroku worked for me:
npm update -g heroku
Not sure what the cause of this was but restarting solved the issue for me. Good luck!
11:53:26 | ~ : heroku update
heroku-cli: Updating CLI from 6.15.26-5726b6f to 6.15.30-e7b41cd...
done
Updating plugins, node version changed to 9.7.1... done
heroku-cli: Updating plugins... done
I had the same problem and I solved removing this file:
/Users/YOUR_USER/Library/Caches/heroku/update.lock
I use mac, but I guess you will have same file in a similar location
I had the same problem on the Mac - solved it by running htop, filtering by heroku and killing all processes.
TLDR; kill running Heroku processes
I also had the same problem and solved it by removing error.log from the following directory in Windows 10: C:\Users\Behzad\.heroku\error.log
I've had this happen twice to me before. The first time I assumed it was an error with NPM, so I uninstalled Node & NPM and didn't use the package that was giving me an error.
I did a fresh install & began working on another project. I'd installed the package (and the version of it with cli). The command line command worked during the terminal session during which i'd installed it both globally and in my project. However in other terminal tabs and in new terminal sessions the command returns command not found.
when I run npm root i receive:
/Users/MYUSERNAME/node_modules
and when I run npm root -g, i receive:
/Users/MYUSERNAME/.npm-global/lib/node_modules
For what it's worth the two packages I've tried this with are mjml (and mjml-cli) and gulp (and gulp-cli). I've uninstalled both and reinstalled again from my root directory using the -g flag and that doesn't seem to have changed anything.
I appear to have missed this somewhere in the googling I did before asking this question.
Apparently I had been accidentally installing global packages in my local folder (/Users/YOURUSERNAME/node_modules).
Running npm config set prefix /usr/local fixed the issue.
I have to switched on the second computer which is running on Windows XP.
I clonned my project from repository, which have structure containtng bower.jcon, Gruntfile.js and other following files and is running without problems on second computer with MacOS X.
After that I launched NodeJS command promtp, moved into the directory where application was clonned and i launched commmand.
C:\workspace\myproject>grunt serve
And I got following error message:
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'
Warning: Task "serve" not found. Use --force to continue.
Whhat I'm doing wrong and how can i solve this issue please?
Many thanks for any help.
EDIT:
I solved it using the following commands:
npm update npm -g
npm install
bower install
grunt serve