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

Can't use the typescript module #2994

Closed
andrerigon opened this issue Jul 2, 2017 · 5 comments
Closed

Can't use the typescript module #2994

andrerigon opened this issue Jul 2, 2017 · 5 comments

Comments

@andrerigon
Copy link

andrerigon commented Jul 2, 2017

I can't run pm2 with the typescript module. I have a processes.json with the following, among other scripts:

 {
    "script": "src/main/entryPoints/persister.ts",
    "name": "persister",
    "source_map_support": true
  }

But when I try to run pm2-docker start pm2/processes-dev.json

I receive the full output of tsc --help:


[STREAMING] Now streaming realtime logs for [all] processes
0|typescri | Version 2.3.2
0|typescri | Syntax:   tsc [options] [file ...]
0|typescri | Examples: tsc hello.ts
0|typescri |           tsc --outFile file.js file.ts
0|typescri |           tsc @args.txt
0|typescri | Options:
0|typescri |  -h, --help                                         Print this message.
0|typescri |  --all                                              Show all compiler options.
0|typescri |  -v, --version                                      Print the compiler's version.
0|typescri |  --init                                             Initializes a TypeScript project and creates a tsconfig.json file.
0|typescri |  -p FILE OR DIRECTORY, --project FILE OR DIRECTORY  Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.

How it was installed:

yarn global add  ts-node@3.0.4 typescript@2.3.2 pm2@2.4.6 \
     && pm2 install typescript@2.3.2 

pm2 list output sometimes shows:

[PM2] PM2 Successfully daemonized
[PM2][Module] Starting module typescript
[PM2][WARN] Applications tsc not running, starting...
[PM2] App [typescript] launched (1 instances)
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────────┘
 Module activated
┌────────────┬─────────┬────────────┬────────┬─────────┬─────┬─────────────┐
│ Module     │ version │ target PID │ status │ restart │ cpu │ memory      │
├────────────┼─────────┼────────────┼────────┼─────────┼─────┼─────────────┤
│ typescript │ N/A     │ N/A        │ online │ 0       │ 0%  │ 14.887 MB 

But also shows:

┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────────┘
 Module activated
┌────────────┬─────────┬────────────┬─────────┬─────────┬─────┬────────┐
│ Module     │ version │ target PID │ status  │ restart │ cpu │ memory │
├────────────┼─────────┼────────────┼─────────┼─────────┼─────┼────────┤
│ typescript │ 2.4.6   │ N/A        │ errored │ 15      │ 0%  │ 0 B    │
└────────────┴─────────┴────────────┴─────────┴─────────┴─────┴────────┘
 Use `pm2 show <id|name>` to get more details about an app

Thanks in advance.

PM2 version: 2.4.6
Node version: v7.10.0
Mac OSX 10.11.6
@andrerigon andrerigon changed the title Problem to run pm2 with typescript Can't use the typescript module Jul 2, 2017
@Unitech
Copy link
Owner

Unitech commented Jul 2, 2017

you cannot do pm2 install typescript@2.3.2

Just type pm2 install typescript

Keep me updated

@andrerigon
Copy link
Author

Hi, thanks for the update. I'll try that ASAP. But won't it install the latest version (^2.4.0)? I need to use the 2.3.2, since the 2.4.0 is more about weak types and can't compile part of the code. Is that possible?

@Unitech
Copy link
Owner

Unitech commented Jul 3, 2017

I see, it's quite simple to implement a regexp there: https://github.com/Unitech/pm2/blob/development/lib/API/Modules/Modularizer.js#L347

Feel free to send a PR!

@Unitech
Copy link
Owner

Unitech commented Jul 4, 2017

fix added feel free to try it:

$ npm install Unitech/pm2#development -g
$ pm2 update

@Unitech
Copy link
Owner

Unitech commented Jul 20, 2017

Published on PM2 2.6.0:

$ npm install pm2@latest -g
$ pm2 update
$ pm2 install typescript@2.3.2

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

No branches or pull requests

3 participants