Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Unresolved JavaScript Reference

I'm writing Javascript on IntelliJ with some env variable use, ex.

const DEBUG = process && process.env.COMMAND_DEBUG === 'true';

But the IDE told me Unresolved variable or type process.

So I tried to switch to this form

import { env } from 'node:process';
const DEBUG = env.COMMAND_DEBUG === 'true';

But I've always a warn on this subject (cf. image).

I'm new to IntelliJ Ultimate version 2023.1.2 with NodeJs and it seems that JavaScript comes with some bundled plugins like JavaScript and TypeScript plugin (we dont have it in IntelliJ Community Edition).

Do you know how could I switch off this warn only for this use case (cause it could be usefull in other case) ?

inspection profile JSandTS plugin Unresolved JavaScript Reference

like image 962
boly38 Avatar asked Oct 28 '25 03:10

boly38


2 Answers

In Intellij IDEs by default you are working in a "browser" environment. For Node.js specific completions and analysis you have to enable it for the project in the settings.

like image 98
Sergey Avatar answered Oct 29 '25 20:10

Sergey


File ->settings -> Languages & Frameworks -> Node.js is where it's located for IntelliJ IDEA 2024.2.1 (Ultimate Edition).

like image 23
John kerich Avatar answered Oct 29 '25 21:10

John kerich