Error creating execution script for ts-Node-dev library

Asked

Viewed 1,596 times

-1

I am building the back-end of an application using Node.js and Typescript, I decided to create a script in package.json to facilitate the execution of the system

I inserted the following script: "scripts": { "build": "tsc","dev:server": "ts-node-dev --inspect --transpileOnly --ignore node_modules src/server.ts" },

includes the flag --Inspect that enables vscode to connect to our Node code in the development environment, and flags --transpileOnly and --ignore node_modules to allow me a faster execution.

but when executing using the command yarn dev:server

I get the following error: inserir a descrição da imagem aqui

I couldn’t solve it completely, I searched the network and found in https://www.npmjs.com/package/ts-node-dev the command: Yarn add ts-Node-dev --dev

Running this command can run the application but without the flags.

  • The right thing wouldn’t be --inspect instead of -inspect? In the image it seems that you only used a hyphen.

1 answer

1


The --transpileOnly has changed in this new version from ts-Node-dev to --trasnpile-only.

use the following command in your package.json script

ts-Node-dev --transpile-only --ignore-watch node_modules src/[start_file]. ts

Browser other questions tagged

You are not signed in. Login or sign up in order to post.