Questions tagged [ts-node]

Short for TypeScript Node. Built to execute TypeScript for Node.js. You might also include TypeScript and/or Node.js - tags if you use this tag.

References

487 questions
0
votes
1 answer

Non-exported variable with the same name across multiple files causing TS2403

I'm a TypeScript newb trying to write a Node.js (Node.ts?) backend, and trying to go about the basics of setting up my server. I'm using ts-node version 8.6.2 and typescript version 3.7.5, and defining validation for some domain objects in the…
Chris
  • 909
  • 8
  • 18
0
votes
0 answers

How to run a .ts file w/ .ts file imports using ts-node?

I'm writing a console script. I have a folder structure like / /helper/methods.ts /index.ts Lets say methods.ts has a function "foo". I'm running: .\node_modules\.bin\ts-node.cmd index.ts I want to do something like import * as helpers from…
McTrafik
  • 2,843
  • 3
  • 29
  • 31
0
votes
0 answers

Javascript Set invalid array lenght with ts-node

I am writing to ask a clarification on a strange behaviour occurred today while working: I am working on a Node JS application written by someone else in plain javascript. I started introducing typescript incrementally, very gradually. I started by…
Apperside
  • 3,542
  • 2
  • 38
  • 65
0
votes
1 answer

ts-node --version runs incredibly long

The execution time of a simple ts-node --version needs a long time I have a fresh virtual maschine (xen, 20GB RAM, lots of free space) with ubuntu 18.04 server. node/npm installed via package manager. Unfortunately the execution of a simple ts-node…
MPH
  • 21
  • 5
0
votes
1 answer

Why can't my globally installed npm package call ts-node?

Ok, I'm trying to create a CLI tool for my own use, basically it just parses standard output of hcitool (which reports on surrounding bluetooth devices). The tool can be found here: https://github.com/lu4/hcitool-reader The tool is expected to be…
Lu4
  • 14,873
  • 15
  • 79
  • 132
0
votes
0 answers

Express Server Restart does not load changes in React Components from JSX files

We have the following setup: NodeJS express server that renders a document from React components defined in .tsx files. The html is used to generate PDF files on the server side. We use ts-node-dev in order to detect changes in the typescript files…
Bernhard
  • 665
  • 1
  • 6
  • 22
0
votes
1 answer

How to run pm2 with node.js ts on debug mode and break on WebStorm

I use latest version of all. This is my pm2.json { "name": "testapi", "script": "ts-node", "args":["/src/index.ts"], "watch": [ "src" ], "ignore_watch":["node_modules"], "env": { "PORT": 3333, "NODE_ENV": "development", …
Omry Atia
  • 73
  • 1
  • 9
0
votes
1 answer

Importing typescript files for Angular project in node server

I am unable to import TS files that exist in my Angular project directories inside my Node server. I've looked into various settings for a tsconfig.json file for the Node server specifically but have had no luck. I run my node server via npm start…
mjschranz
  • 76
  • 2
0
votes
1 answer

How to include *.vue files from mocha testing

in my project i use typescript and vue.js. I decided to write some unit test and tried to use mocha + ts-node. Problem is that when i run mocha it tries to load all files included *.vue which gives me error. Ts-node just doesn't know how to handle…
abradas
  • 91
  • 4
0
votes
1 answer

Node.js 10 require('...') from node_modules is terribly slow

I'm using the latest Node.js LTS 10 on Windows 10 and macOS 10.14.3. When I import a library using the require like const require = require('rollup'); it takes about 10 minutes or more to import a library. I started noticing the problem after adding…
Alexander Shutau
  • 2,660
  • 22
  • 32
0
votes
1 answer

Mocha - Experimental support for decorators is a feature that is subject to change in a future release

I'm trying to run a unit test with Mocha using the below command in Windows. mocha --require ts-node/register test.spec.ts and getting the following error error TS1219: Experimental support for decorators is a feature that is subject to change in a…
David Hawkins
  • 1,049
  • 1
  • 10
  • 30
0
votes
1 answer

Issues with breakpoints in ts-node

I faced a very strange problem. I have two working PC and one of them stop breaking on the breakpoints in one day. Another PC works properly the same as before. I tried to reinstall Node JS, ts-node and then even hard reset for windows (I use…
kkost
  • 3,640
  • 5
  • 41
  • 72
0
votes
1 answer

Does ts-node support '@' style import? If so, how to set it up?

I'm creating a command-line script, using classes from the main express app. Script resides in the folder: bin/utils/ ├── sync-buyers.ts └── tsconfig.json The main express app is in /app use uses import '@/foo/bar/thing. This is set up in the…
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
0
votes
1 answer

Docker alpine does nothing on command inside shell

I have the following docker declaration for Alpine based node application. FROM node:8-alpine RUN npm install typescript RUN npm install ts-node RUN npm install puppeteer CMD [ "/bin/sh" ] Inside it I'm trying to launch puppeteer to render some…
Artsiom Miksiuk
  • 3,896
  • 9
  • 33
  • 49
0
votes
1 answer

Subfolders not being compiled for dev

I am using TypeScript to create my nodejs application, which is working fine inasmuch as the index.ts is being compiled and executed successfully, but the TypeScript files in subfolders are being ignored and don't form part of the dev watch. Can…
serlingpa
  • 12,024
  • 24
  • 80
  • 130