I am fairly new to Visual Studio Code and have been following a tutorial to create Node.js applications with Visual Studio Code.
I need to create a jsconfig.json file, the tutorial informs me that there should be a green lightbulb in the status bar, which will generate the file when clicked on. Unfortunately, I cannot see it and I am pretty sure that it should be showing, considering there is no jsconfig.json file in the 'myExpressApp' folder. Please see the screenshot...
I am fairly new to Visual Studio Code and have been following a tutorial to create Node.js applications with Visual Studio Code.
I need to create a jsconfig.json file, the tutorial informs me that there should be a green lightbulb in the status bar, which will generate the file when clicked on. Unfortunately, I cannot see it and I am pretty sure that it should be showing, considering there is no jsconfig.json file in the 'myExpressApp' folder. Please see the screenshot...
Share Improve this question edited Apr 22, 2022 at 12:12 Peter Mortensen 31.6k22 gold badges110 silver badges133 bronze badges asked Nov 27, 2016 at 16:20 user3599231user3599231 1011 gold badge2 silver badges5 bronze badges 3-
Which tutorial are you following? Also, do you mean
tsconfig.json
? – Aurora0001 Commented Nov 27, 2016 at 16:41 - I am following code.visualstudio./docs/runtimes/… – user3599231 Commented Nov 27, 2016 at 17:06
- If any of the answers helped you, don't forget to upvote and accept them (or provide feedback if they aren't helpful). You'll also get a small rep bonus when you accept answers (+2). – Aurora0001 Commented Nov 29, 2016 at 16:59
2 Answers
Reset to default 2If you are on a Visual Studio Code Insiders build, with recent versions of Visual Studio Code, if you are only using JavaScript, a jsconfig.json file is no longer required. If none is provided, the root directory will be treated as an implicit JavaScript project.
If you are working with TypeScript, you still need a tsconfig.json file. See Aurora0001's answer for creating this.
I'll update the Visual Studio Code documentation/tutorial to reflect this change.
It seems odd that the lightbulb doesn't appear as expected, but you can still generate a jsconfig.json yourself. If you're planning to use TypeScript, you can just run this in your terminal (in the project directory):
tsc --init
This will create a tsconfig.json file ready for you (you'll need to then add "allowJs": true
in that file, because that makes it equivalent to jsconfig.json
).
You could also just click 'New File', copy in the contents from the tutorial and save. There shouldn't be any detrimental effect to your project by not clicking the lightbulb to do it.