Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P109 ts-node不需要加引号 #161

Open
LittleStoney opened this issue Jan 30, 2020 · 10 comments
Open

P109 ts-node不需要加引号 #161

LittleStoney opened this issue Jan 30, 2020 · 10 comments

Comments

@LittleStoney
Copy link

没看英文版的,中文版的确有问题
"build:live": "nodemon --watch './src/**/*.ts' --exec 'ts-node' src/index.ts"
运行会报错,需要去掉ts-node的引号可以运行

@LittleStoney
Copy link
Author

没看英文版的,中文版的确有问题
"build:live": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
运行会报错,正确写法如下:
nodemon --watch src/*.ts --exec ts-node src/index.ts

@jkchao
Copy link
Owner

jkchao commented Feb 2, 2020

我刚试了下,我这边是没问题的。请问你那边报错是什么了?

@LittleStoney
Copy link
Author

找不到ts-node

@jkchao
Copy link
Owner

jkchao commented Feb 2, 2020

有安装 ts-node 包吗?

@jkchao
Copy link
Owner

jkchao commented Feb 2, 2020

node 版本贴一下

@LittleStoney
Copy link
Author

LittleStoney commented Feb 2, 2020

@%BAC023PKQ9_I}YU8D6C2G
9ACGTLL2W_}T004XY8CZ{)X
node最新的12.14

@jkchao
Copy link
Owner

jkchao commented Feb 2, 2020

改成 nodemon --watch "src/*.ts" --exec \"ts-node\" src/app.ts 试试。

https://stackoverflow.com/questions/44764004/ts-node-is-not-recognized-as-an-internal-or-external-command-operable-program

@LittleStoney
Copy link
Author

都没问题,但是书上的写法肯定不行

@jkchao
Copy link
Owner

jkchao commented Feb 2, 2020

系统不相同吧,我补充一下说明

@LittleStoney
Copy link
Author

嗯好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants