Nrlint install issues

Hi! I'm having trouble getting the new nrlint to work with my newly updated NR 2.0.1 installation. I'm following the instructions as stated here GitHub - node-red/nrlint: Node-RED Flow Linter, but am not able to start my nodered after adding the require line into my settings.js.

Running Windows 10 and removing the line

        nrlint: require("./.nrlintrc.js"),

from my module.exports inside of the settings.js at least lets me start nodered again.

Any thoughts on what I am missing here?

PS C:\Users\joost\.node-red> node-red
Error loading settings file: \Users\j.kroes\.node-red\settings.js
C:\Users\joost\.node-red\.nrlintrc.js:1
��m


SyntaxError: Invalid or unexpected token
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\joost\.node-red\settings.js:488:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

The line settings.js:488:17 refers to the start of the "require" in the nrlint export.

Did you check the contents of .nrlintrc.js? I tripped over something similar yesterday, because the init command had failed due to a typo and the file contained the error message instead of the intended JS output. :see_no_evil:

Feel free to raise an issue so things like this can get fixed.

Yeah, checked that.

To my utter surprise, linting now seems to be working, without the addition of the line in the settings.js. So either it is not needed there, or it is added automatically in the background (it is not currently in the settings.js file)?

Anyway, my flows are now showing linting in the admin ui at least, so that is something!

If you don't provide a settings file then the linter falls back to the defaults.

It wasn't always the case, hence the readme telling you to generate the file. Docs could do with an update.

That mistake was on my end. I mistyped something after npx, so I redirected its usage info instead of the expected JS output into the .nrlintrc.js file. Stupid me. :sweat_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.