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.
Questions tagged [ts-node]
487 questions
0
votes
0 answers
Error on connect to local mongodb with Mongoose when using ts-node?
I'm having issues connecting to my local MongoDB. On connection, it fails with the following error message:
MongooseServerSelectionError: connection timed out
reason: TopologyDescription {
type: 'Single',
setName: null,
maxSetVersion:…

denislexic
- 10,786
- 23
- 84
- 128
0
votes
0 answers
Typescript - Dynamic class Type
I'm trying to build a sort of model Factory in Typescript.
I'm receiving a string parameter from an API call and I would like to istantiate a new object depending on the received value.
Here you can find a simple example of what I would like to…

Micko
- 41
- 1
- 5
0
votes
0 answers
Sinon stub failed when upgrade ts-node to v10
Everything is ok when my ts-node version is 8.x ~ 9.x , but sinon stub failed when I upgraded ts-node to 10.x
The code likes below:
// file: ./lambda.ts
export const getAWSLambda = () => new AWS.Lambda({ region: AWS_DEFAULT_REGION });
export class…

Rife
- 487
- 2
- 7
- 18
0
votes
1 answer
Is it impossible to use private class field(js) in raspberrypi?
the code below works well on window, but the error occur when I try to run it on raspberrypi4
const { AES } = require('./crypto');
const fetch = require('node-fetch');
const FormData = require('form-data');
const { load } = require('cheerio'); …

tadashi
- 3
- 1
0
votes
1 answer
Type 'Article | null' is not assignable to type 'void'
I am trying to implement an interface into a class using typescript.
This is my class:
import connector from '../../../../common/mysql.persistence'
import { Article } from '../../domain/article'
import { ArticleRepository } from…

Diesan Romero
- 1,292
- 4
- 20
- 45
0
votes
1 answer
Possible to extend NodeJS resolver?
I would like to automatically inject a condition to the NodeJS resolver.
My projects use the exports field with exports depending on the configuration I am running (test, development, prodtest, default etc)
This is easily configurable in…

FrozenKiwi
- 1,362
- 13
- 26
0
votes
1 answer
Can I configure`ts-node` when using `webpack-dev-server`?
My project structure is like this
.
└── my-app/
├── .configs/
│ ├── tsconfig.json
│ ├── webpack.merge.ts
│ ├── webpack.dev.config.ts
│ └── webpack.prod.config.ts
├── node_modules
├── src/
│ └── index.tsx
…

M.Holmes
- 403
- 1
- 7
- 22
0
votes
0 answers
How to solve memory heap error ts-node-dev?
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
During development, memory heap errors keep coming up and development is delayed.
I set node memory to prevent this, but I don't know if it…

minjae kim
- 139
- 2
- 9
0
votes
0 answers
typescript propogate options throghout projects
I am splitting typescript project into subprojects. And referencing them by file path. And it works fine. But when I try running mocha tests it fails.
I use ts-node/require. The root of the problem is that project uses amd. When everything was under…

tsadigov
- 25
- 6
0
votes
0 answers
Configure ts-node load typescript library files
UPDATE:
Even with ts-node --files node_modules/typescript/lib/lib.d.ts ./lib/foo.ts I'm still unable to get this to work.
ORIGINAL:
I have this simple file called foo.ts that I'm trying to process with ts-node.
export class foo extends HTMLElement…

haroldcampbell
- 1,512
- 1
- 14
- 22
0
votes
1 answer
Npm i ts-node-dev --save-dev leads to no such file or directory, chmod node_modules/ts-node-dev/lib\bin.js'
I try to install ts-node-dev:
npm i ts-node-dev --save-dev
And get the error:
ENOENT: no such file or directory, chmod
'/node_modules/ts-node-dev/lib\bin.js'

mr_blond
- 1,586
- 2
- 20
- 52
0
votes
1 answer
Using `--max-http-header-size` option for ts-node
Couldn't use ts-node with --max-http-header-size 15000.
I can use it with node, but there is no such option for ts-node

Krasnay Danil
- 101
- 1
- 9
0
votes
0 answers
What is the correct way of transpiling?
I am using TypeScript and ts-node to execute my script as follows:
node -r ts-node/register index.ts
This works fine, but the compilation process takes too long so I would like to speed everything up. I noticed, that I might also just transpile the…

Daniel Stephens
- 2,371
- 8
- 34
- 86
0
votes
1 answer
How to pass separate TypeScript config for TSNode when it has being indecency running by Mocha & IntellIJ IDEA?
Although TS-Node started the ECMAScript modules support, it has a lot of limitations and below example:
import { assert as Assert } from "chai";
describe("firstTest", (): void => {
it("", (): void => {
Assert.isTrue(true);
});
});
does…

Takeshi Tokugawa YD
- 670
- 5
- 40
- 124
0
votes
1 answer
Configuring TypeORM for typescript ignores reflect-metadata
I'm working on a node project and I'm using typeORM for the first time so I know this is probably user error. My ideal setup would be:
Use the typeorm cli via ts-node to generate *.ts migrations based on the *.ts entities.
Compile the typescript to…

Psibean
- 153
- 1
- 10