Asked to Run 'npm install' each time I make a new project in webstorm

17 views
Skip to first unread message

Timothy Chiang

unread,
Apr 3, 2024, 2:26:31 PMApr 3
to Illuminated Cloud Q&A
hi there, I keep getting ESLint settings warnings asking me to Run 'npm install' whenever I make a new SFDX project. I don't think VSCode ever asks me for this. Is this something unique to intellij/webstorm?

Timothy Chiang

unread,
Apr 3, 2024, 2:26:50 PMApr 3
to Illuminated Cloud Q&A, Timothy Chiang
CleanShot 2024-04-03 at 14.23.58@2x.png

Scott

unread,
Apr 3, 2024, 4:37:06 PMApr 3
to Illuminated Cloud Q&A, t...@blumauconsulting.com
The commercial JetBrains IDEs -- including WebStorm -- provide full support for JavaScript, TypeScript, etc., and the associated ecosystem frameworks, tools, etc. This includes Node.js and it's package manager, npm:


When you create a new Salesforce DX project, IC2 uses the Salesforce CLI's "force:project:create" / "project generate" command to do so. That command creates the resulting project directory structure from a pre-defined template which includes a package.json file with npm dependencies for LWC development, e.g., Jest, ESLint, etc.

When the JetBrains IDE sees that file, it checks the expressed dependencies and installed dependencies are in sync and, if not, it prompts you to run "npm install" to bring them up-to-date. That's the prompt you're seeing immediately after creating a new project for which dependencies have not yet been installed. You'll also see that prompt if/when the package.json file's contents change.

If you're developing LWC components, you'll want those dependencies because they help provide a high-quality, more strongly-typed development experience in the IDE. Without them many TS/ES6 types won't resolve properly, Jest tests cannot be run, ESLint static code analysis won't work, etc.

I hope that explains what you're seeing. Please let me know if you have any other questions.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages