I cant Install any nodes in embedded node-red

hi please i need some help
I use this template

installed with

# Create a project folder and change into it
mkdir myproject && cd myproject
# Clone this repository into the project folder
git clone https://github.com/sbarwe/node-red-template-embedded.git .
# Install the pre-requisite modules (Express, Node-Red)
npm install
# Install some additional nodes if required ...
#npm install node-red-contrib-xx node-red-contrib-yy --save
# Start the server (runs 'node server.js')
npm start

but when install any new nods from manage palette I see Error msg
but log in the debug mode

03/01/21, 10:14:14 [info]  Installing module: node-red-dashboard, version: 2.28.1
03/01/21, 10:14:14 [debug]  npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-dashboard@2.28.1
03/01/21, 10:14:24 [debug]  [out] + node-red-dashboard@2.28.1
03/01/21, 10:14:24 [debug]  [out] updated 1 package in 4.677s
03/01/21, 10:14:24 [debug]  rc=0
03/01/21, 10:14:24 [info]  Installed module: node-red-dashboard

so I back to guide

Installing Node-Red nodes

Node-Red nodes are installed as npm modules. With this project template, you have two options when installing new nodes.

  1. Project LevelMake sure you are in the main project folder and install using npm as usual. Update your main project package.json file (or use npm --save ).This is the simplest approach and the one I use. However, it does mean that, if you want to run another node-red instance from the same project folder, you have to use the same installed modules.
  2. User LevelChange into your user folder ( ./.nodered by default) before using npm . You will need to do an npm init -y the first time as I haven't included a package.json file in that folder.This seems to me to be more complex to manage. However, it does have the advantage that you can use the project (optionally with some shared nodes installed) with multiple instances each with their own nodes or different versions of the same nodes.
  3. Developing node-red nodesIf you use the setup to isolate the development of a node-red node you should use npm link to link and install to and from your original development directory (e.g. a seperate git-repository). Use npm run dev to start the node-red instance with debugging features. See npm scripts for more information.

any help

so i switched to another way
https://nodered.org/docs/user-guide/runtime/embedding

but same issuse i cant add anything - node-red events log :

2021-03-01T13:15:11.607Z Install : node-red-dashboard 2.28.1

2021-03-01T13:15:11.654Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-dashboard@2.28.1
2021-03-01T13:15:12.816Z [err] Debugger attached.
2021-03-01T13:15:27.167Z [err] npm 
2021-03-01T13:15:27.167Z [err] WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
2021-03-01T13:15:29.120Z [out] + node-red-dashboard@2.28.1
2021-03-01T13:15:29.120Z [out] updated 1 package in 9.783s
2021-03-01T13:15:29.136Z [err] Waiting for the d
2021-03-01T13:15:29.136Z [err] ebugger to disconnect...
2021-03-01T13:15:29.235Z rc=0
-----------------------------------------------------------
2021-03-01T13:27:54.760Z Install : node-red-contrib-ui-svg 2.2.1

2021-03-01T13:27:54.767Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-ui-svg@2.2.1
2021-03-01T13:27:55.797Z [err] Debugger attached.
2021-03-01T13:28:07.584Z [out] + node-red-contrib-ui-svg@2.2.1
2021-03-01T13:28:07.584Z [out] added 28 packages from 28 contributors in 10.345s
2021-03-01T13:28:07.630Z rc=0

and for node-red debug in terminal:

03/01/21, 14:07:01	[info] 	Starting flows
03/01/21, 14:07:01	[info] 	Started flows
03/01/21, 14:08:36	[info] 	Installing module: node-red-dashboard, version: 2.28.1
03/01/21, 14:09:03	[info] 	Installed module: node-red-dashboard
03/01/21, 14:27:54 - [info] Installing module: node-red-contrib-ui-svg, version: 2.2.1
03/01/21, 14:28:07 - [info] Installed module: node-red-contrib-ui-svg

but cant show installed nodes in node-red dashboard
what problems

It has installed ok. Try refreshing the browser window.

thanks to replay
but i checked and restart server and nothing

when check this file .config.json
I Discovred all installed new nodes its missing in this config file whay not add it Automaticaly!
so I add it manualy but not work again, Issus no solved

"node-red-contrib-ui-svg": {
        "name": "node-red-contrib-ui-svg",
        "version": "1.3.0",
        "local": true,
        "nodes": {
            "ui_svg_graphics": {
                "name": "ui_svg_graphics",
                "types": [
                    "ui_svg_graphics"
                ],
                "enabled": true,
                "local": true,
                "module": "node-red-contrib-ui-svg",
                "file": "D:\\Project\\node-red-template-embedded\\.nodered\\node_modules\\node-red-contrib-ui-svg\\svg_graphics.js"
            }
        }
    },

so i check the config file one more and all my new line code its deleted
whay when Start node-red server its delete my new config and back to Defautl config whay this !

ok I updated some IDs
i installed nodes with npm cmd

cd $poject/.nodered
npm install <npm-package-name>

Installed package but anything in dashboard

cd $poject/.nodered
npm install <npm-package-name> --save

Installed package but anything in dashboard

so i changed PATH and last cmd its:

cd $poject/
npm install <npm-package-name> --save

its works

so i changed prefex into installer.js

D:\Project\node-red-template-embedded\node_modules\@node-red\registry\lib\installer.js
prefix=~
to 
D:\Project\node-red-template-embedded\node_modules\
var args = ['install','--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=D:\\Project\\node-red-template-embedded','--production',installName];

and start node-red server
install new package to test
but show MSG Error Log in dashboard
so restart server and load dashboard if any change
but nothing changed issus is still I cant show new installed package in dashboard
else installed manually from CLI
any id to resolve this please

The .config.nodes.json (or .config.json if you are on an old version of NR) file is not a file you edit. It contains a record of what the runtime has found when loading the palette of nodes.

I can't immediately see why this isn't working for you. I know you've just raised an issue against Node-RED for this - but this is not a core issue. If anything, it will be an issue with the template you are starting with.

Is there a reason you are using that template rather than doing a normal install of Node-RED?

1 Like

normal Node-red dont have any Issus
but when I use Embended node-red I cant Show any nodes Installed in my Edito node-red

so i switched to another way
Embedding into an existing app : Node-RED

but same issuse i cant add anything - node-red events log Error

and worked for me only with this way

so i changed PATH and last cmd its:

cd $poject/
npm install <npm-package-name> --save

its works

so i changed prefex into installer.js

D:\Project\node-red-template-embedded\node_modules\@node-red\registry\lib\installer.js
prefix=~
to 
D:\Project\node-red-template-embedded\node_modules\
var args = ['install','--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=D:\\Project\\node-red-template-embedded','--production',installName];

and start node-red server
install new package to test
but show MSG Error Log in dashboard
so restart server and load dashboard if any change
but nothing changed issus is still I cant show new installed package in dashboard
else installed manually from CLI
any id to resolve this please

Potentially the same OP asking on Stack Overflow?

Looking at the code, I can't see how we can get from the rc=0 to a promise rejection and a failure message.

Please run the following 2 tests:

  1. Use the full path to the userDir in the settings object: D:\\Project\\node-red-template-embedded\\hhh
  2. Use just hhh without the leading ./

I think this might be a windows path joining issue in the loadNodeFiles()

3 Likes

wow its works
very thanks man

  1. Use the full path to the userDir in the settings object: D:\\Project\\node-red-template-embedded\\hhh

worked

  1. Use just hhh without the leading ./

not working

One more test please

  • userDir as ".\\hhh"

not work with

".\\hhh"

ok so i fixed with this path.join();


var settings = {
    httpAdminRoot: "/red",
    httpNodeRoot: "/api",
    userDir: path.join(__dirname, ".hhh"),
    functionGlobalContext: {} // enables global context
};

That is the right workaround until we can find a Windows 10 VM to debug properly and work out what is happening in the core code.

1 Like

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