Pm2: Can't start .bat file

Created on 26 Feb 2018  Β·  2Comments  Β·  Source: Unitech/pm2

Your issue may already be reported!
Please search on the issue tracker before creating one.

What's going wrong?

When I try to start a .bat file, I got this error:

ImportaΓ§Γ£o de produto > D:\apps\Pentaho_8.0.0\data-integration\Kitchen.bat:1 
ImportaΓ§Γ£o de produto > (function (exports, require, module, __filename, __dirname) { @echo off
ImportaΓ§Γ£o de produto > SyntaxError: Invalid or unexpected token
ImportaΓ§Γ£o de produto >     at createScript (vm.js:80:10)
ImportaΓ§Γ£o de produto >     at Object.runInThisContext (vm.js:139:10)
ImportaΓ§Γ£o de produto >     at Module._compile (module.js:599:28)
ImportaΓ§Γ£o de produto >     at Object.Module._extensions..js (module.js:646:10)
ImportaΓ§Γ£o de produto >     at Module.load (module.js:554:32)
ImportaΓ§Γ£o de produto >     at tryModuleLoad (module.js:497:12)
ImportaΓ§Γ£o de produto >     at Function.Module._load (module.js:489:3)
ImportaΓ§Γ£o de produto >     at Object.<anonymous> (C:\Users\luiz.weber\AppData\Roaming\npm\node_modules\pm2\lib\
ProcessContainerFork.js:83:21)
ImportaΓ§Γ£o de produto >     at Module._compile (module.js:635:30)
ImportaΓ§Γ£o de produto >     at Object.Module._extensions..js (module.js:646:10)

How could we reproduce this issue?

pm2 start anyfile.bat
```` 

## Supporting information

Please run the following command (available on PM2 >= 2.6)

===============================================================================

--- PM2 REPORT (Mon Feb 26 2018 15:18:12 GMT-0300 (E. South America Standard Time))

--- Daemon -------------------------------------------------
pm2d version : 2.10.1
node version : 8.9.1
node path : undefined
argv : C:Program Filesnodejsnode.exe,C:Usersluiz.weberAppDataRoamingnpmnode_modulespm2libDaemon.js
argv0 : node
user : undefined
uid : N/A
gid : N/A

uptime : 5644min

--- CLI ----------------------------------------------------
local pm2 : 2.10.1
node version : 8.9.1
node path : undefined
argv : C:Program Filesnodejsnode.exe,C:Usersluiz.weberAppDataRoamingnpmnode_modulespm2binpm2,report
argv0 : node

user : luiz.weber

--- System info --------------------------------------------
arch : x64
platform : win32
type : Windows_NT
cpus : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
cpus nb : 4
freemem : 1395499008
totalmem : 8471072768

home : C:Usersluiz.weber

--- PM2 list -----------------------------------------------
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ App name β”‚ id β”‚ mode β”‚ pid β”‚ status β”‚ restart β”‚ uptime β”‚ cpu β”‚ mem β”‚ user β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Kitchen β”‚ 0 β”‚ fork β”‚ 0 β”‚ errored β”‚ 15 β”‚ 0 β”‚ 0% β”‚ 0 B β”‚ luiz.weber β”‚ disabled β”‚

β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

--- Daemon logs --------------------------------------------
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ App name β”‚ id β”‚ mode β”‚ pid β”‚ status β”‚ restart β”‚ uptime β”‚ cpu β”‚ mem β”‚ user β”‚ watching β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Kitchen β”‚ 0 β”‚ fork β”‚ 0 β”‚ errored β”‚ 15 β”‚ 0 β”‚ 0% β”‚ 0 B β”‚ luiz.weber β”‚ disabled β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Use pm2 show <id|name> to get more details about an app
```

Most helpful comment

After all this time, I searched again for the same term and ended up in this thread.
The problem was the interpreter mode. To start .bat files, you must manually set the interpreter to none.

pm2 start some.bat --interpreter none

All 2 comments

After all this time, I searched again for the same term and ended up in this thread.
The problem was the interpreter mode. To start .bat files, you must manually set the interpreter to none.

pm2 start some.bat --interpreter none

Thanks, worked like a charm. I recently started using pm2 on my W10 machine and ran straight into this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

morfies picture morfies  Β·  3Comments

ghost picture ghost  Β·  3Comments

ldarren picture ldarren  Β·  3Comments

FujiHaruka picture FujiHaruka  Β·  3Comments

shaunwarman picture shaunwarman  Β·  3Comments