How can i use the node-red command line?

Hello
sorry for the Newbie question.
i like to directly
npm install ........

but i dont found the node red command line input for Command-line Administration

Hello @prato.

What is it you want to install with npm?
What operating system do you have Node-red installed on?

Hello, i have already installed Node Red on Ubuntu 20.04 and works fine.

i like to install Midi Player found on:

midi-player - npm

midi-player is published on npm and can be installed as usual.

with the command:

npm install midi-player

I'm not familiar with Midi Player, but it looks like you install it at the Ubuntu command line AKA the dollar prompt.
But it wouldn't be integrated with Node-red unless you find and also install Node-red node for the task.

That node is not a node-red node (it is a regular NPM module)

You could use a function node to import the module (see the setup tab on the function node) and code the functionality in the same function node (in the on message tab).

NOTE: To use that package in a function (i.e. in the NODE environment as opposed to a browser) you will likely also need to import web-midi-api


Alternatively, if you were to use windows, there is a contrib node node-red-contrib-midi-windows - I guess from the title it wont work on Ubuntu 20.04

@ Steve-Mcl

first i have tried to install over Palette the [node-red-contrib-midi-windows] but the intallation fails with some error messages.

Telling us "some error" is not really a lot to go on however it is likely meant only for windows (not ubuntu)

tried also the
node-red-contrib-mid

Here the log

<
2022-01-21T15:37:04.298Z Installieren : node-red-contrib-midi 1.0.1

2022-01-21T15:37:04.277Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-midi@1.0.1
2022-01-21T15:37:11.519Z [out] 
2022-01-21T15:37:11.519Z [out] > node-aead-crypto@2.2.1 preinstall /root/.node-red/node_modules/node-aead-crypto
2022-01-21T15:37:11.519Z [out] > node lib/preinstall.js
2022-01-21T15:37:11.519Z [out] 
2022-01-21T15:37:11.643Z [err] node-aead-crypto not needed on this system, since all ciphers are natively supported
2022-01-21T15:37:11.670Z [out] 
2022-01-21T15:37:11.670Z [out] > midi@0.9.5 install /root/.node-red/node_modules/midi
2022-01-21T15:37:11.670Z [out] > node-gyp rebuild
2022-01-21T15:37:11.670Z [out] 
2022-01-21T15:37:12.778Z [err] gyp
2022-01-21T15:37:12.779Z [err]  
2022-01-21T15:37:12.779Z [err] ERR!
2022-01-21T15:37:12.779Z [err]  
2022-01-21T15:37:12.779Z [err] build error
2022-01-21T15:37:12.779Z [err]  
2022-01-21T15:37:12.779Z [err] gyp
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] ERR!
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] stack
2022-01-21T15:37:12.780Z [err]  Error: not found: make
2022-01-21T15:37:12.780Z [err] gyp
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] ERR!
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] stack
2022-01-21T15:37:12.780Z [err]      at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
2022-01-21T15:37:12.780Z [err] gyp
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] ERR!
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] stack
2022-01-21T15:37:12.780Z [err]      at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
2022-01-21T15:37:12.780Z [err] gyp
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] ERR!
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] stack
2022-01-21T15:37:12.780Z [err]      at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
2022-01-21T15:37:12.780Z [err] gyp
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.780Z [err] ERR!
2022-01-21T15:37:12.780Z [err]  
2022-01-21T15:37:12.781Z [err] stack
2022-01-21T15:37:12.781Z [err]      at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
2022-01-21T15:37:12.781Z [err] gyp
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] ERR!
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] stack
2022-01-21T15:37:12.781Z [err]      at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2022-01-21T15:37:12.781Z [err] gyp
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] ERR!
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] stack
2022-01-21T15:37:12.781Z [err]      at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2022-01-21T15:37:12.781Z [err] gyp
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] ERR!
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] stack
2022-01-21T15:37:12.781Z [err]      at FSReqCallback.oncomplete (fs.js:168:21)
2022-01-21T15:37:12.781Z [err] gyp
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.781Z [err] ERR!
2022-01-21T15:37:12.781Z [err]  
2022-01-21T15:37:12.782Z [err] System
2022-01-21T15:37:12.782Z [err]  Linux 5.4.0-73-generic
2022-01-21T15:37:12.782Z [err] gyp
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] ERR!
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] command
2022-01-21T15:37:12.782Z [err]  "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-01-21T15:37:12.782Z [err] gyp
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] ERR!
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] cwd
2022-01-21T15:37:12.782Z [err]  /root/.node-red/node_modules/midi
2022-01-21T15:37:12.782Z [err] gyp
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] ERR!
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] node -v
2022-01-21T15:37:12.782Z [err]  v12.22.1
2022-01-21T15:37:12.782Z [err] gyp
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] ERR!
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.782Z [err] node-gyp -v
2022-01-21T15:37:12.782Z [err]  v5.1.0
2022-01-21T15:37:12.782Z [err] gyp
2022-01-21T15:37:12.782Z [err]  
2022-01-21T15:37:12.783Z [err] ERR!
2022-01-21T15:37:12.783Z [err]  
2022-01-21T15:37:12.783Z [err] not ok
2022-01-21T15:37:12.783Z [err]  
2022-01-21T15:37:13.072Z [err] npm
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] WARN
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] optional
2022-01-21T15:37:13.073Z [err]  SKIPPING OPTIONAL DEPENDENCY: node-aead-crypto@2.2.1 (node_modules/node-aead-crypto):
2022-01-21T15:37:13.073Z [err] npm
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] WARN
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] optional
2022-01-21T15:37:13.073Z [err]  SKIPPING OPTIONAL DEPENDENCY: node-aead-crypto@2.2.1 preinstall: `node lib/preinstall.js`
2022-01-21T15:37:13.073Z [err] npm
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] WARN
2022-01-21T15:37:13.073Z [err]  
2022-01-21T15:37:13.073Z [err] optional
2022-01-21T15:37:13.073Z [err]  SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2022-01-21T15:37:13.074Z [err] 
2022-01-21T15:37:13.085Z [err] npm
2022-01-21T15:37:13.085Z [err]  
2022-01-21T15:37:13.085Z [err] ERR!
2022-01-21T15:37:13.085Z [err]  
2022-01-21T15:37:13.085Z [err] code
2022-01-21T15:37:13.085Z [err]  ELIFECYCLE
2022-01-21T15:37:13.085Z [err] npm
2022-01-21T15:37:13.085Z [err]  
2022-01-21T15:37:13.085Z [err] ERR!
2022-01-21T15:37:13.085Z [err]  
2022-01-21T15:37:13.085Z [err] errno
2022-01-21T15:37:13.085Z [err]  1
2022-01-21T15:37:13.089Z [err] npm
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] ERR!
2022-01-21T15:37:13.089Z [err]  midi@0.9.5 install: `node-gyp rebuild`
2022-01-21T15:37:13.089Z [err] npm
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] ERR!
2022-01-21T15:37:13.089Z [err]  Exit status 1
2022-01-21T15:37:13.089Z [err] npm
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] ERR!
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] npm
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] ERR!
2022-01-21T15:37:13.089Z [err]  Failed at the midi@0.9.5 install script.
2022-01-21T15:37:13.089Z [err] npm
2022-01-21T15:37:13.089Z [err]  
2022-01-21T15:37:13.089Z [err] ERR!
2022-01-21T15:37:13.089Z [err]  This is probably not a problem with npm. There is likely additional logging output above.
2022-01-21T15:37:13.098Z [err] 
2022-01-21T15:37:13.098Z [err] npm
2022-01-21T15:37:13.098Z [err]  
2022-01-21T15:37:13.099Z [err] ERR!
2022-01-21T15:37:13.099Z [err]  A complete log of this run can be found in:
2022-01-21T15:37:13.099Z [err] npm
2022-01-21T15:37:13.099Z [err]  
2022-01-21T15:37:13.099Z [err] ERR!
2022-01-21T15:37:13.099Z [err]      /root/.npm/_logs/2022-01-21T15_37_13_092Z-debug.log
2022-01-21T15:37:13.108Z rc=1
/>

There are a number of known issues around installation with that 5 year old node

On this particular issue, a has a user suggested workaround

thank you

t think it's not worth the effort for an old trouble node.

my initial question remains how do I start node red admin for commands like::

target - Set or view the target URL and port like http://localhost:1880
login - Log user in to the target of the Node-RED admin API
list - List all of the installed nodes
info - Display more information about the module or node
enable - Enable the specified module or node set
disable - Disable the specified module or node set
search - Search for Node-RED modules to install
install - Install the module from NPM to Node-RED
remove - Remove the NPM module from Node-RED

It is described in the help...

https://nodered.org/docs/user-guide/node-red-admin

Which command in particular are you trying to perform?

i know this side

Since Node-RED 1.1.0, node-red-admin is now built into the node-red command - you do not need to install it separately

But where should i insert the commands ? ???

In a terminal window on the node-red machine or another node-red server where node-red is installed.

From the docs...

To use the version included with node-red, use the command node-red admin

So for example

node-red admin target http://localhost:1880

and

node-red admin login

and for others...

node-red admin help

i am confused

Where
to insert the command ???

node-red admin target http://lxx.xxx.xxx.xxx:1880

sorry

Open a terminal on your Ubuntu machine where node-red is installed.

Enter node-red admin help

What do you see?

thanks ... thats the needed answer in terminal SSH !!

i thought i have to find a command line at Node Red dash

thank you very much

I think you missed the suggestion in the node red install instructions for Ubuntu/Debian/Pi to run
sudo apt install build-essential git curl

However, if you just want to install an npm module from the command line then go to your .node-red directory and run
npm install the_module

Though as suggested earlier, there is generally no need to do this as node-red will do it for you if you use the functionExternalModules option described in Writing Functions : Node-RED

@Colin

Great ..... i do that and i have just installed
node-red-contrib-midi-windows
again
works! thank you

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