Getting runtime errors
I am trying the run pm2. Yesterday it worked. I was using "pm2-docker" and everything just worked. Today when I run nothing works. I tried just running "pm2". I get the below issue. Any thoughts?
Expected behaviour
I should get no errors.
Actual behaviour
I get the following errors
RangeError: Maximum call stack size exceeded
at String.slice (native)
at Object.resolve (path.js:258:27)
at Object._makeLong (path.js:666:32)
at Object.fs.mkdirSync (fs.js:922:35)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:71:13)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
RangeError: Maximum call stack size exceeded
at String.slice (native)
at Object.resolve (path.js:258:27)
at Object._makeLong (path.js:666:32)
at Object.fs.mkdirSync (fs.js:922:35)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:71:13)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
Error: ENOENT: no such file or directory, open 'H:.pm2\module_conf.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at Client.initFileStructure (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:153:10)
at new module.exports (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:37:8)
at new module.exports (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\API.js:99:17)
at Object.
Steps to reproduce
Just run the following command
pm2
Software versions used
OS : Windows 7
node.js : 6
PM2 : 2.4.0
PM2 Log output
Use the command: tail --lines 50 ~/.pm2/pm2.log
This command does not work ...
cf CONTRIBUTING.md for more informations
To workaround, you just need to create a file called module_conf.json inside the PM2_HOME path (should be ~/.pm2/ by default, and just put {} inside it.
I will make a fix tomorrow !
This commit should have fixed the problem, could you retry ? : npm install -g Unitech/pm2#development && pm2 update
I'm sorry but I am still getting errors. I ran the command you gave and I also called "npm uninstall -g pm2" and then ran the command again. In both cases I got the same result.
RangeError: Maximum call stack size exceeded
at String.slice (native)
at Object.resolve (path.js:258:27)
at Object._makeLong (path.js:666:32)
at Object.fs.mkdirSync (fs.js:922:35)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:71:13)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
RangeError: Maximum call stack size exceeded
at String.slice (native)
at Object.resolve (path.js:258:27)
at Object._makeLong (path.js:666:32)
at Object.fs.mkdirSync (fs.js:922:35)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:71:13)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
at sync (C:\MetLife_SourceCode\g_npm\node_modules\pm2\node_modules\mkdirp\index.js:77:24)
Error: ENOENT: no such file or directory, open 'H:\.pm2\module_conf.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at Client.initFileStructure (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:153:10)
at new module.exports (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:37:8)
at new module.exports (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\API.js:99:17)
at Object.<anonymous> (C:\MetLife_SourceCode\g_npm\node_modules\pm2\bin\pm2:19:11)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
-------------
PM2 process manager
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
_\///______________\///______________\///__\///////////////__
Getting started
Documentation
http://pm2.io/
Start PM2 at boot
$ pm2 startup
Daemonize Application
$ pm2 start <app>
Monitoring/APM solution
https://app.keymetrics.io/
-------------
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'H:\.pm2\pm2.log'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Client.launchDaemon (C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:208:14)
at C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:101:10
at C:\MetLife_SourceCode\g_npm\node_modules\pm2\lib\Client.js:285:14
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Could you share here the environment you have on Windows (but remove any potential sensitive data) ?
Sure, but to make sure I get exactly what you want could you be more specific on what you might want "environment" wise?
- Windows 7 Enterprise SP1
- Node 6.3.1
- npm 3.10.7
Because i need to know how can pm2 not find your user home, see this file that should resolve it to an actual valid path.
Up @CodeMedic42
I have the same problem. How should I solve it?
I resolved the problem ran the command npm uninstall pm2 -g
deleted the folder .pm2 at H: and I ran npm install pm2 -g again