3

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...

Screenshot of problem

3
  • Which tutorial are you following? Also, do you mean tsconfig.json? Commented Nov 27, 2016 at 16:41
  • I am following code.visualstudio.com/docs/runtimes/… 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). Commented Nov 29, 2016 at 16:59

2 Answers 2

2

If 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.

Sign up to request clarification or add additional context in comments.

1 Comment

I believe that I am on 1.7.2 recovery build. But not an insiders build.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.