Node Red In A Jail

Status
Not open for further replies.

Soloam

Contributor
Joined
Feb 14, 2014
Messages
196
I'm trying to install node red in a jail, but it keep getting this error:

Code:
root@nodered:/ # npm install -g --unsafe-perm node-red 
npm ERR! code Z_DATA_ERROR 
npm ERR! errno Z_DATA_ERROR 
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/node-red: invalid distance too far back 

npm ERR! A complete log of this run can be found in: 
npm ERR!	 /root/.npm/_logs/2018-05-22T21_32_38_094Z-debug.log


Code:
root@nodered:/ # tail /root/.npm/_logs/2018-05-22T21_32_38_094Z-debug.log 
11 verbose stack	 at Gunzip.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/pump/index.js:31:21) 
12 verbose cwd / 
13 verbose FreeBSD 11.1-STABLE 
14 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "--unsafe-perm" "node-red" 
15 verbose node v10.1.0 
16 verbose npm  v6.0.1 
17 error code Z_DATA_ERROR 
18 error errno Z_DATA_ERROR 
19 error Invalid response body while trying to fetch https://registry.npmjs.org/node-red: invalid distance too far back 
20 verbose exit [ 1, true ]


Code:
root@nodered:/ # node -v
v10.1.0
root@nodered:/ # npm -v
6.0.1


Any idea?
Thank you
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Just for S&G, I wonder if it works fine with Node v8.

Can you try perhaps v8 instead of v10 node?
 

Soloam

Contributor
Joined
Feb 14, 2014
Messages
196
Just for S&G, I wonder if it works fine with Node v8.

Can you try perhaps v8 instead of v10 node?

A lot of warnings in the install to upgrade for safty reasons, but it works, its running:

Code:
pkg install node8
pkg install npm-node8


Code:
root@nodered:/ # npm install -g --unsafe-perm node-red 
npm WARN deprecated bcrypt@1.0.3: bcrypt < v2.0.0 is susceptible to bcrypt wrap-around bug. Upgrade to bcrypt >= v2.0.0 for improved support for newer bcrypt hashes 
npm WARN deprecated i18next-client@1.10.3: you can use npm install i18next from version 2.0.0 
npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/ 
npm WARN deprecated mailparser@0.6.2: This project is unmaintained 
npm WARN deprecated mimelib@0.3.1: This project is unmaintained 
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained 
npm WARN deprecated buildmail@2.0.0: This project is unmaintained 
/usr/local/bin/node-red -> /usr/local/lib/node_modules/node-red/red.js 
/usr/local/bin/node-red-pi -> /usr/local/lib/node_modules/node-red/bin/node-red-pi 

> bcrypt@1.0.3 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt 
> node-pre-gyp install --fallback-to-build 

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v57-freebsd-x64.tar.gz  
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.3 and node@8.11.1 (node-v57 ABI) (falling back to source compile with node-gyp)  
gmake: Entering directory '/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build' 
 CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o 
 CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o 
 CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o 
 SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node 
 COPY Release/bcrypt_lib.node 
 COPY /usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node 
 TOUCH Release/obj.target/action_after_build.stamp 
gmake: Leaving directory '/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build' 
+ node-red@0.18.6 
added 335 packages from 353 contributors in 597.925s


So the last version does not work in FreeBSD?

thank you
 
Last edited:

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
So, I don't know much about node.js at all. However, I did some reading about it when I saw your post, and everything I've found on node-red referred to version 6 or 8 LTS for the underlying node. Literally everything.

I therefore suspected that it was node-red itself that may be expecting version 8.

I don't have a better explanation than that, unfortunately---you should do some research with the node-red guys; I would doubt it's FreeBSD's fault. I am glad, though, that my suggestion at least gets you going with a working install.
 

Soloam

Contributor
Joined
Feb 14, 2014
Messages
196
Thank you for all your help @DrKK
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Status
Not open for further replies.
Top