# How can i use the node-red command line?

**URL:** <https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017>\
**Category:** General\
**Created:** [21 January 2022 14:08 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017 "2022-01-21T14:08:17Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 14:08 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/1 "2022-01-21T14:08:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 January 2022 14:18 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/2 "2022-01-21T14:18:47Z")

</div>

Hello @prato.

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

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 14:30 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/3 "2022-01-21T14:30:41Z")

</div>

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](https://www.npmjs.com/package/midi-player)

_`midi-player` is published on [npm](https://www.npmjs.com/package/midi-player) and can be installed as usual._

with the command:

npm install midi-player

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 January 2022 14:37 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/4 "2022-01-21T14:37:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 14:54 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/5 "2022-01-21T14:54:18Z")

</div>

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](https://www.npmjs.com/package/web-midi-api)

* * *

Alternatively, if you were to use windows, there is a contrib node [node-red-contrib-midi-windows](https://flows.nodered.org/node/node-red-contrib-midi-windows) - I guess from the title it wont work on Ubuntu 20.04

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 15:02 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/6 "2022-01-21T15:02:01Z")

</div>

@ Steve-Mcl

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 15:05 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/7 "2022-01-21T15:05:50Z")

</div>

> [@prato](#):
>
> 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)

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 15:41 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/8 "2022-01-21T15:41:04Z")

</div>

tried also the  
node-red-contrib-mid

Here the log

```auto

```

```auto
<
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
/>

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 15:51 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/9 "2022-01-21T15:51:02Z")

</div>

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

> **[Issues · urbiworx/node-red-contrib-midi](https://github.com/urbiworx/node-red-contrib-midi/issues)**
>
> Contribute to urbiworx/node-red-contrib-midi development by creating an account on GitHub.

On [this particular issue](https://github.com/urbiworx/node-red-contrib-midi/issues/14#issuecomment-967803470), a has a user suggested workaround

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 16:24 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/10 "2022-01-21T16:24:22Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 16:32 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/11 "2022-01-21T16:32:38Z")

</div>

> [@prato](#):
>
> my initial question remains how do I start node red admin for commands like

It is described in the help...

[https://nodered.org/docs/user-guide/node-red-admin](https://nodered.org/docs/user-guide/node-red-admin)

Which command in particular are you trying to perform?

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 16:39 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/12 "2022-01-21T16:39:24Z")

</div>

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 ? ???

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 17:04 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/13 "2022-01-21T17:04:53Z")

</div>

> [@prato](#):
>
> 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

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

```

and

```bash
node-red admin login

```

and for others...

```bash
node-red admin help

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/9985a6cfdb7413eefeb6efe6eb8e421560bbbf01.png)

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 17:12 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/14 "2022-01-21T17:12:19Z")

</div>

i am confused

Where  
to insert the command ???

**node-red admin target [http://lxx.xxx.xxx.xxx:1880](http://lxx.xxx.xxx.xxx:1880)**

sorry

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2022 17:14 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/15 "2022-01-21T17:14:00Z")

</div>

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

Enter `node-red admin help`

What do you see?

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 17:23 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/16 "2022-01-21T17:23:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 January 2022 17:28 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/17 "2022-01-21T17:28:25Z")

</div>

> [@prato](#):
>
> `2022-01-21T15:37:12.780Z [err] Error: not found: make`

I think you missed the suggestion in the [node red install instructions for Ubuntu/Debian/Pi](https://nodered.org/docs/getting-started/raspberrypi) 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](https://nodered.org/docs/user-guide/writing-functions#using-the-functionglobalcontext-option)

---

<div class="post-metadata">

**Author:** ![prato](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@prato](https://discourse.nodered.org/u/prato)\
**Post date:** [21 January 2022 18:09 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/18 "2022-01-21T18:09:59Z")

</div>

@Colin

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 February 2022 18:10 UTC](https://discourse.nodered.org/t/how-can-i-use-the-node-red-command-line/57017/19 "2022-02-04T18:10:45Z")

</div>

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