简体   繁体   English

我想用 javascript 语言构建 NestJS 应用程序,但它在 tsconfig.json 上给出了一些错误

[英]I want to build NestJS app in javascript language but it give some error on tsconfig.json

Can you help me how to build nestjs with language javascript?你能帮我用 javascript 语言构建 nestjs 吗? i was create the nestjs app with "nest new --language js new-app-name", and i want to deploy it into vercel.我用“nest new --language js new-app-name”创建了 nestjs 应用程序,我想将它部署到 vercel 中。 i was try to build with nest build but it show an error message like this: " Error Could not find TypeScript configuration file "tsconfig.json". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace)".我尝试使用 nest build 进行构建,但它显示如下错误消息:“错误无法找到 TypeScript 配置文件“tsconfig.json”。请确保您在适当的目录(在 Nest 工作空间内)中运行此命令” . after read the message i check my files again and i found that i doesn't have tsconfig.json but i have an jsconfig.json.阅读消息后,我再次检查我的文件,发现我没有 tsconfig.json,但我有一个 jsconfig.json。

so, is anybody have some soution with my problems?那么,有人对我的问题有意见吗? i'll be glad if someone know how to fix it.如果有人知道如何修复它,我会很高兴。 Thank you谢谢

i was try to change the command like: "nest build --project jsconfig.json" "nest build --jsonfig jsconfig.json" "npm run build"我试图改变命令,如:“nest build --project jsconfig.json”“nest build --jsonfig jsconfig.json”“npm run build”

but it doesn't work但它不起作用

I expect my nestjs can build properly我希望我的 nestjs 可以正常构建

nest build only works with .ts files. nest build仅适用于.ts文件。 For writing and running a Nest application in regular JavaScript you'll need to use babel with the run command being babel-node index.js .要在常规 JavaScript 中编写和运行 Nest 应用程序,您需要使用babel ,运行命令为babel-node index.js There's no "building" to be done, so nest build won't do anything.没有要完成的“构建”,所以nest build不会做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM