简体   繁体   中英

How do I fix this error with tsconfig.json

I'm running the npm run dev script for this one node.js website and it's launching the website locally but giving me this error:

PS C:\Users\yairk\OneDrive\Desktop\personal-website-3D-main> npm run dev

> dev
> webpack serve --config ./bundler/webpack.dev.js

Project running at:
  - http://192.168.0.168:8080
  - http://localhost:8080
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.0.168:8080/
<i> [webpack-dev-server] Content not from webpack is served from 'C:\Users\yairk\OneDrive\Desktop\personal-website-3D-main\static' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
ERROR in ./src/script.ts 
[tsl] ERROR
      TS18002: The 'files' list in config file 'tsconfig.json' is empty.

ERROR in ./src/script.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: error while parsing tsconfig.json
    at Object.loader (C:\Users\yairk\OneDrive\Desktop\personal-website-3D-main\node_modules\ts-loader\dist\index.js:17:18)

webpack compiled with 2 errors

I can't seem to find the tsconfig.json file in the folders and I'm not sure how I would be able to fix this as the website still runs but with these 2 errors.

The error is misleading. You're missing a tsconfig.json file in the root directory of your project.

Here is a sample template with include instead of files : https://github.com/realm/node-template-project/blob/master/tsconfig.json

This directive tells TypeScript where are *.ts files located.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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