[SOLVED] - Having trouble installing node-red-admin on CentOS-8

I’m attempting to set up a node-red docker, and am having issues installing node-red-admin. It would seem that there is a permissions issue, maybe? I’m not sure. Anyways, I was hoping if I showed this to you guys, somebody smart can slap me in the head and tell me what I need to do to fix this.

[mark@markslab custom_components]$ sudo npm install -g node-red-admin
/usr/bin/node-red-admin -> /usr/lib/node_modules/node-red-admin/node-red-admin.js

> [email protected] install /usr/lib/node_modules/node-red-admin/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib'
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/10.19.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/.node-gyp'
gyp ERR! System Linux 4.18.0-193.6.3.el8_2.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/lib/node_modules/node-red-admin/node_modules/bcrypt
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/node-red-admin/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.18.0-193.6.3.el8_2.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-red-admin/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/node-red-admin/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/lib/node_modules/node-red-admin/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/node-red-admin/node_modules/bcrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 11 packages from 20 contributors in 11.378s

After getting the docker pulled, and showing in Portainer, I don’t have anything in my directory. So, no settings.js file to edit with my password hash.

[mark@markslab custom_components]$ ls -l node-red
total 0

Equally frustrating, I have a partially installed version of node-red-admin

[mark@markslab custom_components]$ node-red-admin
Usage:
   node-red-admin <command> [args] [--help] [--userDir DIR] [--json]

Description:
   Node-RED command-line client

Commands:
   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
   hash-pw - Creates a hash to use for Node-RED settings like "adminAuth"

I’m not sure if this is helpful or not, but this was my docker pull:

docker run -d \
--name=node-red \
--restart=always \
-p 1880:1880 \
-u 1000:1000 \
-v /home/mark/Home-Assistant/custom-components/node-red:/data \
nodered/node-red-docker:v8

No errors during install.

Any guidance you guys have would be greatly appreciated. Hell, I don’t even mind a bit of mocking if it gets me to where I need to be.

Thanks fellas

I’m an idiot…

Home-Assistant and Home_Assistant are NOT the same directories…

Duh. :man_facepalming: