Not able to run typescript node.js app with ts-node with pm2pm2 json config not running app properlyapp keeps restarting with pm2 although killedpm2 app restarts randomly without reasonpm2 running on EC2 using jenkins not working?Windows: Auto start PM2 and node appsHow can i split particular data(status,name) from this variable?pm2 running at 100% CPU - how to debugHow to only restart node process with PM2 if exit code != 0node.js watch the folder and run scriptPM2 EPERM, Operation not permitted on call initgroups

Is open-sourcing the code of a webapp not recommended?

What is the `some` keyword in SwiftUI?

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

C++ Arduino IDE receiving garbled `char` from function

How Often Do Health Insurance Providers Drop Coverage?

PhD - Well known professor or well known school?

What can I, as a user, do about offensive reviews in App Store?

Thread Pool C++ Implementation

How to signal to my players that the following part is supposed to be played on fast forward?

Using "subway" as name for London Underground?

Does an ice chest packed full of frozen food need ice?

Mobile App Appraisal

Fixing obscure 8080 emulator bug?

How do governments keep track of their issued currency?

Universal hash functions with homomorphic XOR property

Should an arbiter claim draw at a K+R vs K+R endgame?

How does an ordinary object become radioactive?

Medieval flying castle propulsion

Does Disney no longer produce hand-drawn cartoon films?

Why doesn't Adrian Toomes give up Spider-Man's identity?

Generate a Graeco-Latin square

What do abbreviations in movie scripts stand for?

Difference between > and >> when used with a named pipe

How to deal with apathetic co-worker?



Not able to run typescript node.js app with ts-node with pm2


pm2 json config not running app properlyapp keeps restarting with pm2 although killedpm2 app restarts randomly without reasonpm2 running on EC2 using jenkins not working?Windows: Auto start PM2 and node appsHow can i split particular data(status,name) from this variable?pm2 running at 100% CPU - how to debugHow to only restart node process with PM2 if exit code != 0node.js watch the folder and run scriptPM2 EPERM, Operation not permitted on call initgroups






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have created a basic node app with typescript top of it. I am using ts-node to do so and it's working totally fine with nodemon. But I need to move it to the server now I am stuck. PM2 is showing error all the time. I have gone through GitHub and other answers on StackOverflow. Nothing helped me here. please help.



I have tried installing typescript and ts-node with PM2. But It did not work for me. I also have tried running file directly, not worked. I am clueless now how should I fix this.



 "scripts": 
"start": "nodemon -x ts-node src/server.ts"
,


It works fine with simple npm run start command



madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
$ npm run start

> NodeType@1.0.0 start E:shaileshnodejsNodeType
> nodemon -x ts-node src/server.ts

[nodemon] 1.18.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `ts-node src/server.ts`
24 Mar 22:33:23 - listening on port 3000
Mongoose default connection is open to mongodb://localhost:27017/todo 😍



What I have tried so far that didn't work *( PM2 is globally installed) *



pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts


It gave me this error



madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
$ pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts
[PM2][ERROR] script not found : E:shaileshnodejsNodeTypets-node
script not found : E:shaileshnodejsNodeTypets-node
┌──────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
└──────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app



I have also used the following



pm2 start npm -- ts-node src/server.ts


and got



$ pm2 start npm -- ts-node src/server.ts
[PM2] Applying action restartProcessId on app [npm](ids: 0)
[PM2] [npm](0) ✓
[PM2] Process successfully started
┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
│ npm │ 0 │ N/A │ fork │ 11300 │ online │ 15 │ 0s │ 0% │ 21.5 MB │ madbo │ disabled │
└──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app

madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
$ pm2 status
┌──────────┬────┬─────────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
│ npm │ 0 │ N/A │ fork │ 868 │ stopped │ 24 │ 0 │ 0% │ 0 B │ madbo │ disabled │
└──────────┴────┴─────────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app



Please help me fixing this



I want it to be working on a server with pm2 on the server. I will be great full if anyone of you can fix my problem. Thanks










share|improve this question




























    1















    I have created a basic node app with typescript top of it. I am using ts-node to do so and it's working totally fine with nodemon. But I need to move it to the server now I am stuck. PM2 is showing error all the time. I have gone through GitHub and other answers on StackOverflow. Nothing helped me here. please help.



    I have tried installing typescript and ts-node with PM2. But It did not work for me. I also have tried running file directly, not worked. I am clueless now how should I fix this.



     "scripts": 
    "start": "nodemon -x ts-node src/server.ts"
    ,


    It works fine with simple npm run start command



    madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
    $ npm run start

    > NodeType@1.0.0 start E:shaileshnodejsNodeType
    > nodemon -x ts-node src/server.ts

    [nodemon] 1.18.5
    [nodemon] to restart at any time, enter `rs`
    [nodemon] watching: *.*
    [nodemon] starting `ts-node src/server.ts`
    24 Mar 22:33:23 - listening on port 3000
    Mongoose default connection is open to mongodb://localhost:27017/todo 😍



    What I have tried so far that didn't work *( PM2 is globally installed) *



    pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts


    It gave me this error



    madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
    $ pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts
    [PM2][ERROR] script not found : E:shaileshnodejsNodeTypets-node
    script not found : E:shaileshnodejsNodeTypets-node
    ┌──────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
    │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
    └──────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
    Use `pm2 show <id|name>` to get more details about an app



    I have also used the following



    pm2 start npm -- ts-node src/server.ts


    and got



    $ pm2 start npm -- ts-node src/server.ts
    [PM2] Applying action restartProcessId on app [npm](ids: 0)
    [PM2] [npm](0) ✓
    [PM2] Process successfully started
    ┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
    │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
    ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
    │ npm │ 0 │ N/A │ fork │ 11300 │ online │ 15 │ 0s │ 0% │ 21.5 MB │ madbo │ disabled │
    └──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
    Use `pm2 show <id|name>` to get more details about an app

    madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
    $ pm2 status
    ┌──────────┬────┬─────────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
    │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
    ├──────────┼────┼─────────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
    │ npm │ 0 │ N/A │ fork │ 868 │ stopped │ 24 │ 0 │ 0% │ 0 B │ madbo │ disabled │
    └──────────┴────┴─────────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘
    Use `pm2 show <id|name>` to get more details about an app



    Please help me fixing this



    I want it to be working on a server with pm2 on the server. I will be great full if anyone of you can fix my problem. Thanks










    share|improve this question
























      1












      1








      1








      I have created a basic node app with typescript top of it. I am using ts-node to do so and it's working totally fine with nodemon. But I need to move it to the server now I am stuck. PM2 is showing error all the time. I have gone through GitHub and other answers on StackOverflow. Nothing helped me here. please help.



      I have tried installing typescript and ts-node with PM2. But It did not work for me. I also have tried running file directly, not worked. I am clueless now how should I fix this.



       "scripts": 
      "start": "nodemon -x ts-node src/server.ts"
      ,


      It works fine with simple npm run start command



      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ npm run start

      > NodeType@1.0.0 start E:shaileshnodejsNodeType
      > nodemon -x ts-node src/server.ts

      [nodemon] 1.18.5
      [nodemon] to restart at any time, enter `rs`
      [nodemon] watching: *.*
      [nodemon] starting `ts-node src/server.ts`
      24 Mar 22:33:23 - listening on port 3000
      Mongoose default connection is open to mongodb://localhost:27017/todo 😍



      What I have tried so far that didn't work *( PM2 is globally installed) *



      pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts


      It gave me this error



      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts
      [PM2][ERROR] script not found : E:shaileshnodejsNodeTypets-node
      script not found : E:shaileshnodejsNodeTypets-node
      ┌──────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      └──────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app



      I have also used the following



      pm2 start npm -- ts-node src/server.ts


      and got



      $ pm2 start npm -- ts-node src/server.ts
      [PM2] Applying action restartProcessId on app [npm](ids: 0)
      [PM2] [npm](0) ✓
      [PM2] Process successfully started
      ┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
      │ npm │ 0 │ N/A │ fork │ 11300 │ online │ 15 │ 0s │ 0% │ 21.5 MB │ madbo │ disabled │
      └──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app

      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ pm2 status
      ┌──────────┬────┬─────────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      ├──────────┼────┼─────────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
      │ npm │ 0 │ N/A │ fork │ 868 │ stopped │ 24 │ 0 │ 0% │ 0 B │ madbo │ disabled │
      └──────────┴────┴─────────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app



      Please help me fixing this



      I want it to be working on a server with pm2 on the server. I will be great full if anyone of you can fix my problem. Thanks










      share|improve this question














      I have created a basic node app with typescript top of it. I am using ts-node to do so and it's working totally fine with nodemon. But I need to move it to the server now I am stuck. PM2 is showing error all the time. I have gone through GitHub and other answers on StackOverflow. Nothing helped me here. please help.



      I have tried installing typescript and ts-node with PM2. But It did not work for me. I also have tried running file directly, not worked. I am clueless now how should I fix this.



       "scripts": 
      "start": "nodemon -x ts-node src/server.ts"
      ,


      It works fine with simple npm run start command



      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ npm run start

      > NodeType@1.0.0 start E:shaileshnodejsNodeType
      > nodemon -x ts-node src/server.ts

      [nodemon] 1.18.5
      [nodemon] to restart at any time, enter `rs`
      [nodemon] watching: *.*
      [nodemon] starting `ts-node src/server.ts`
      24 Mar 22:33:23 - listening on port 3000
      Mongoose default connection is open to mongodb://localhost:27017/todo 😍



      What I have tried so far that didn't work *( PM2 is globally installed) *



      pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts


      It gave me this error



      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ pm2 start ts-node -- --type-check -r tsconfig-paths/register src/server.ts
      [PM2][ERROR] script not found : E:shaileshnodejsNodeTypets-node
      script not found : E:shaileshnodejsNodeTypets-node
      ┌──────────┬────┬─────────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      └──────────┴────┴─────────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app



      I have also used the following



      pm2 start npm -- ts-node src/server.ts


      and got



      $ pm2 start npm -- ts-node src/server.ts
      [PM2] Applying action restartProcessId on app [npm](ids: 0)
      [PM2] [npm](0) ✓
      [PM2] Process successfully started
      ┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬───────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼───────┼──────────┤
      │ npm │ 0 │ N/A │ fork │ 11300 │ online │ 15 │ 0s │ 0% │ 21.5 MB │ madbo │ disabled │
      └──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴───────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app

      madbo@DESKTOP-CS5UFKE MINGW64 /e/shailesh/nodejs/NodeType
      $ pm2 status
      ┌──────────┬────┬─────────┬──────┬─────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
      │ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
      ├──────────┼────┼─────────┼──────┼─────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
      │ npm │ 0 │ N/A │ fork │ 868 │ stopped │ 24 │ 0 │ 0% │ 0 B │ madbo │ disabled │
      └──────────┴────┴─────────┴──────┴─────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘
      Use `pm2 show <id|name>` to get more details about an app



      Please help me fixing this



      I want it to be working on a server with pm2 on the server. I will be great full if anyone of you can fix my problem. Thanks







      node.js typescript pm2 ts-node






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 17:17









      Shailesh JhaShailesh Jha

      444




      444






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326415%2fnot-able-to-run-typescript-node-js-app-with-ts-node-with-pm2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326415%2fnot-able-to-run-typescript-node-js-app-with-ts-node-with-pm2%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript