我正在学习一个教程,这个家伙使用ts节点,所以我做了同样的操作,并通过纱线安装了它,但是它显示了这个错误。
ts-node : The term 'ts-node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ts-node .\deploy.ts
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (ts-node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException所以我搜索了一下,尝试在全球范围内添加它,但是它仍然显示出相同的错误,你们能帮我找出问题所在吗,因为我想学习TypeScript的基础知识,明天进行测试。
发布于 2022-10-22 18:46:40
的较新的可执行文件
如果纱线全局安装不工作,请使用
yarn add --dev ts-node依赖项在本地安装,并以yarn ts-node形式运行。通常情况下,最简单的解决方案。tsx,这样做更好只要使用yarn tsx watch deploy,就足以使服务器在每次文件更改时重新启动(我通常添加一些签入,这样脚本就会跳过编写,如果是文件覆盖或部署脚本)
https://stackoverflow.com/questions/74162697
复制相似问题