0
votes

Embedding into an existing app

https://nodered.org/docs/user-guide/runtime/embedding

so when go to Manage palette and Install any new nodes I see Error in Editor

Failed to install: node-red-contrib-ui-svg

Cannot find module 'node-red-contrib-ui-svg

Check the log for more information

and this full log :

2021-03-07T10:26:01.901Z Install : node-red-contrib-ui-svg 2.2.1

2021-03-07T10:26:01.910Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production [email protected]
2021-03-07T10:26:10.448Z [err] npm notice
2021-03-07T10:26:10.449Z [err]  created a lockfile as package-lock.json. You should commit this file.
2021-03-07T10:26:10.450Z [out] + [email protected]
2021-03-07T10:26:10.450Z [out] added 29 packages from 28 contributors in 6.044s
2021-03-07T10:26:10.488Z rc=0

but when checking new installed nodes in editor cant show its . and after restart node-red same issus this my nodejs app:

var http = require('http');
var express = require("express");
var RED = require("node-red");


// Create an Express app
var app = express();

// Add a simple route for static content served from 'public'
app.use("/", express.static("public"));


// Create a server
var server = http.createServer(app);


// Create the settings object - see default settings.js file for other options
var settings = {
    httpAdminRoot: "/red1",
    httpNodeRoot: "/api",
    userDir: "./hhh",
    functionGlobalContext: {} // enables global context
};



// Initialise the runtime with a server and settings

RED.init(server, settings);


// Serve the editor UI from /red
app.use(settings.httpAdminRoot, RED.httpAdmin);


// Serve the http nodes UI from /api
app.use(settings.httpNodeRoot, RED.httpNode);


server.listen(8005);


// Start the runtime
RED.start();
node-red : v1.2.9-git
npm -v : 6.14.4
node -v : v12.16.3
1
The log output implies that the install has succeeded. Edit the question to show how you've set up the embedded instance and where you've put things like the userDir - hardillb
And if you look under .hhh the SVG node is present? Also what version of Node-RED, nodejs and npm are you using? - hardillb
yes its found, PATH: .hhh\node_modules\node-red-contrib-ui-svg. and my version node-red : v1.2.9-git, npm -v : 6.14.4, node -v : v12.16.3, - 94r4d0x
Is this you? discourse.nodered.org/t/… If so please continue to work on this on discourse, posting it here as well will just split the effort. - hardillb
I made it here for not receiving a response from the forum. ok thanks to replay - 94r4d0x

1 Answers

0
votes

thanks to hardillb its solved

Please run the following 2 tests: Use the full path to the userDir in the settings object: D:\Project\node-red-template embedded\hhh