'ts-node' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'ts-node' is not recognized as an internal or external command, operable program or batch file

查看:66
本文介绍了'ts-node' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Vs Code 终端和命令提示符出现错误,提示 'ts-node' 未被识别为内部或外部命令、可运行的程序或批处理文件.终端中的启动命令 npm run dev,我也添加了我的 package.json 文件.

I'm getting error in my Vs Code terminal and command prompt that 'ts-node' is not recognized as an internal or external command, operable program or batch file. while i'm trying the start command in the terminal npm run dev and i have added my package.json file also.

{
"name": "tsnode",
"version": "1.0.0",
"description": "ts-node experiment.",
"scripts": {
    "dev": "nodemon --exec 'ts-node --cache-directory .tscache' ./server.ts",
    "start": "ts-node --fast ./server.ts"
},
"author": "Mugesh",
"license": "ISC",
"dependencies": {
    "@types/body-parser": "^1.16.3",
    "@types/chalk": "^0.4.31",
    "@types/express": "^4.0.35",
    "@types/node": "^7.0.18",
    "body-parser": "^1.17.1",
    "chalk": "^1.1.3",
    "express": "^4.15.2",
    "nodemon": "^1.11.0",
    "ts-node": "^3.0.4",
    "typescript": "^2.3.4"
}

}

推荐答案

需要安装ts-node为全局

npm install -g ts-node

更多信息

https://github.com/TypeStrong/ts-node

这篇关于'ts-node' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆