Alternate-node-red-installer issues nodeJS v20

Hello, @TotallyInformation just wanted to inform that after nodejs V20 update your alternate installer is not available:
Issue created: unable to install nodered v4 · Issue #11 · TotallyInformation/alternate-node-red-installer · GitHub

Thanks for letting me know. I'll see if I can update it.

The dependency comes from the replace-in-file package. Unfortunately, the latest version (v8) has some massive breaking changes in it. So I will try updating to v7 to see if that improves things at least.

However, the issues you highlighted should not prevent its installation. They are only warnings not errors.

Well I tried to install it on my clean PC.

Result I've got:
image

alternate-node-red installer is not recognized...

After using alternate installer for few years it is the first time I see this issue, and it happened after I updated to nodeJs v20, so I automatically assumed it was an issue

OK, looks like I need to change my node.js version. I've been still using v18 as this is the min version for node-red v4 and uibuilder v7.

I am still checking what the issues are. But as I say, unfortunately, getting past the glob warning is going to require a redevelopment. May take me some time.

Thankfully, the workaround is easy while you are waiting.

  1. Create a new folder
  2. Install node-red into that folder.
  3. Add this to the package.json in that folder: "start": "node node_modules/node-red/red.js --userDir ./data",
  4. Create a data sub-folder.
  5. Start node-red with npm start

what am I missing? I've always used alternate installer to handle multiple instances. I've tried searching in forum where main response is "drop -g tag" but I don't get any node_modules files in my created directory, only global ones are updated
image

Well that's odd. I wonder if something changed in a recent npm update.

Sorry, realised I missed a step. You need to do a npm init -y in the project folder before installing Node-RED otherwise it picks up your global install anyway. I tend to forget that because I never install it globally.

Also, best to install node red with npm install node-red --production --unsafe-perm

1 Like

OK, so I just installed the latest node.js v20 on my Windows 11 PC. Uninstalled the alt installer and tried to install again.

With the result that it all worked fine:

C:\src\alternate-node-red-installer [(master)]
> npm install -g alternate-node-red-installer
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

added 62 packages, and changed 1 package in 3s

18 packages are looking for funding
  run `npm fund` for details
C:\src\alternate-node-red-installer [(master)]
> nrinstall
Usage: -f <root-folder-name>

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
  -f, --folder    Root folder, Node-RED will be installed here
                                                             [string] [required]
      --no-color  Turn off ANSI color output                           [boolean]

Missing required argument: f
C:\src\alternate-node-red-installer [(master)]
>

Tried an actual install as well and got the expected outputs:

C:\src
> mkdir nrtest1

    Directory: C:\src

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          01/07/2024    16:40                nrtest1

C:\src
> nrinstall -f nrtest1
⠋ InstallingReplaced "<root-folder-name>" with C:\src\nrtest1 [
  { file: 'C:/src/nrtest1/system/node-red.service', hasChanged: true }
]
{ folder: 'C:\\src\\nrtest1' }
Replaced "<root-folder-name>" with C:\src\nrtest1 [ { file: 'C:/src/nrtest1/data/envfile.ini', hasChanged: true } ]
⠏ Installing
   ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                                              │
   │   Alternate Installer for Node-RED                                                                           │
   │                                                                                                              │
   │   Root Folder . . : C:\src\nrtest1                                                                           │
   │   Templates Folder: C:\Users\julia\AppData\Roaming\npm\node_modules\alternate-node-red-installer\templates   │
   │                                                                                                              │
   │   Copied template master folder from templates to root folder: C:\src\nrtest1                                │
   │   Copied template data (userDir) folder to C:\src\nrtest1\data                                               │
   │   Node-RED v4.0.1 successfully installed                                                                     │
   │   Copied master settings.js                                                                                  │
   │   Check `example-settings.js` if you want an enhanced settings file.                                         │
   │                                                                                                              │
   │                                                                                                              │
   ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

NPM COMMAND OUTPUT

added 312 packages, and audited 313 packages in 16s

60 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

NPM COMMAND ERROR OUTPUT
npm warn config production Use `--omit=dev` instead.

C:\src
>

For future me (and others):

  1. Create a new folder
  2. npm init -y
  3. Install node-red into that folder npm install node-red --production --unsafe-perm.
  4. Add this to the package.json in that folder: "start": "node node_modules/node-red/red.js --userDir ./data",
  5. Create a data sub-folder.
  6. Start node-red with npm start
1 Like

I believe issue is with company policy changes (the only way I can explain it) tried to run it on 2 different company PC without success. Got same result as you've shown on my personal PC.

Bad assumption from my part, at least learned to create multiple instances manually

1 Like

No worries. Maybe just keep the package for reference as it has a few other enhancements as well. Though they probably don't generally apply for local dev environments.

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