seanpmaxwell / express-generator-typescript

Create a new express app similar to express-generator but with TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'ts-node' is not recognized as an internal or external command, operable program or batch file.

nathanhannig opened this issue · comments

I am on Windows 10.
NPM v7.5.1
Node v15.8.0

$ npm run start:dev

> express-gen-ts@0.0.0 start:dev
> nodemon

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src\**\*
[nodemon] watching extensions: ts,html
[nodemon] starting `ts-node -r tsconfig-paths/register ./src`
'ts-node' is not recognized as an internal or external command,
operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...

I change the package.json file nodemonConfig to specify the path.

"nodemonConfig": {
    "watch": [
        "src"
    ],
    "ext": "ts, html",
    "ignore": [
        "src/public"
    ],
    "exec": "./node_modules/.bin/ts-node -r tsconfig-paths/register ./src"
},

It works.

$ npm run start:dev

> express-gen-ts@0.0.0 start:dev
> nodemon

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src\**\*
[nodemon] watching extensions: ts,html
[nodemon] starting `./node_modules/.bin/ts-node -r tsconfig-paths/register ./src`

I am not sure if this issue is environmental or not. I am just learning Typescript and wanted to use your npm package to quickly bootstrap a project to begin learning; so apologies if I am missing anything is setting up TS properly.

I don;t have ts-node installed globally; not sure if this could lead to the issue not being caught?

Hello,
have you tried to install the ts-node as a global dependency maybe this works?
and another thing I am not American I am Brazilian then if my text has some error please alert me

On windows/linux I do npm i -g ts-node and it works

Yes, I am sure it works with installing it globally, but normally installing globals isn't the best practice. It would be best to reference the local install instead?

Okay I'll update it, maybe this weekend.

done. Please see version 1.7.3