Vince
Vince

Reputation: 1416

VsCode intellisense for dependencies in package.json

When i'm writing my dependencies in my package.json it should have intellisense for the package i'm trying to put inside dependencies

ex:

"bootstr" => should show a list of sugestion with "bootstrap" in it...

I get a list with one item => "bootstr"

enter image description here

so it doesn't make any sense...

I've tried in all my other project and i'm getting this problem. What is broken ?

Upvotes: 2

Views: 1863

Answers (1)

sazzy4o
sazzy4o

Reputation: 3343

There are a lot of potential causes of this problem. Here are a couple of issues that I have run into before:

1. VS Code Settings

What to check:

Go to settings.json (there will be at least two of these for you, one for your workspace and one for your user)

  1. Open settings:

Ctrl+, (or File->Preferences->Settings)

  1. Open settings.json: Settings navigate

  2. Make sure to check all versions of the settings:

User and workspace

I think there are a few settings that can cause this, so you might want to search for settings with json, but the files.associations is one that can break intellisense for package.json:

"files.associations": {
    "*.json": "javascript"
},

Fix:

Delete the *.json (or other json) entry

2. Malformed package.json

What to check:

Make sure npm can parse your package.json

Fix:

Make sure your package.json is properly formed (No missing comma, no extra brackets, no comments)

Upvotes: 2

Related Questions