Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: spawn ..\Roaming\npm\node_modules\pm2\node_modules\.bin\ts-node ENOENT #4263

Closed
yeongjet opened this issue Apr 29, 2019 · 15 comments
Closed
Labels

Comments

@yeongjet
Copy link

yeongjet commented Apr 29, 2019

What's going wrong?

After running pm2 install typescript and pm2 start hello.ts got this error.
pm2 is global installed on win10, have check these issues: #2742 #3312 #2675 but haven't solve it.
C:\Users\me\AppData\Roaming\npm\node_modules\pm2\node_modules\.bin\ts-node is exists.

Supporting information

$ pm2 report

PM2        | 2019-04-30T03:45:22: PM2 log: Stopping app:hello id:25
PM2        | 2019-04-30T03:45:22: PM2 error: app=hello id=25 does not have a pid
PM2        | 2019-04-30T03:45:49: PM2 log: App [hello:26] starting in -fork mode-
PM2        | 2019-04-30T03:45:49: PM2 log: App [hello:26] online
PM2        | 2019-04-30T03:45:49: PM2 error: Error: spawn C:\Users\me\AppData\Roaming\npm\node_modules\pm2\node_modules\.bin\ts-node ENOENT
PM2        |     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:19)
PM2        |     at onErrorNT (internal/child_process.js:431:16)
PM2        |     at processTicksAndRejections (internal/process/task_queues.js:84:17)
PM2        | 2019-04-30T03:45:49: PM2 error: Cancelling versioning data parsing

But it's running successful under the cluster mode: pm2 start .\hello.ts -i max

@Falagan
Copy link

Falagan commented May 15, 2019

+1

@tzjoke
Copy link

tzjoke commented May 28, 2019

I'm facing the same problem. It was OK several months ago.

@yeongjet @Falagan Have you solved the problem?

@yeongjet
Copy link
Author

yeongjet commented Jun 2, 2019

@tzjoke No, I think it should run with cluster mode.

@tzjoke
Copy link

tzjoke commented Jun 2, 2019

@yeongjet Well, now it does work under cluster mode but it worked well with fork mode before for sure. Weird...

@ginus
Copy link

ginus commented Jul 15, 2019

+1

@chenwenqin
Copy link

chenwenqin commented Oct 22, 2019

+1
it just happened in win10 under fork mode,the same dose not happen in ubuntu,what it happened?

@stale
Copy link

stale bot commented May 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 23, 2020
@stale stale bot closed this as completed Jun 7, 2020
@Ryuurock
Copy link

Ryuurock commented Oct 9, 2020

???? @Unitech

@malekashkar
Copy link

This still happens, has anyone found fixes? Please tag me if you have.

@nsigel
Copy link

nsigel commented Mar 2, 2021

Any luck, guys? Still having this issue

@zwift-tuan
Copy link

Having the same issue on windows but not on linux. Anyone have any luck?

@albaylood1437
Copy link

+1

what do you mean

@ysfaran
Copy link

ysfaran commented Sep 24, 2021

It feels like the devs really don't care about windows issues at all.. I'm trying to use pm2 so bad but there is always an issue specifically related to windows..

most of the issues are already open for more than two years and there is still no response from the devs

@GunasekaranR
Copy link

Hi Team,
Iam also facing the issue when trying to run the typescript with the Pm2. Any one has any solution please suggest.

Before executing I have installed
pm2 install typescript

Command used to execute the script:
pm2 start index.ts .env.staging --name aman-user-service

image

@DarioKolic
Copy link

DarioKolic commented Sep 30, 2022

If anyone needs a potential solution (it solved my ts-node problem)
Make sure you have typescript installed in pm2

For current working directory:

npm i --save-dev pm2

In package.json add a script:

"postinstall": "pm2 install typescript"

This will install typescript globally or in current working directory to pm2 node_modules when you run npm install
If you have global and don't want a script just run it

Finally change exec_mode to cluster

For some reason exec_mode: "fork" does not work with ts-node

Your script file can now have .ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests