Installing Node-red On IMX6S 256 ram Error

I am Trying to install node-red, but cant yet
node version = 4.6.1
npm version = 2.15.9

root@colibri-imx6:~# npm install -g --unsafe-perm node-red
npm WARN engine node-red@1.0.2: wanted: {"node":">=8"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine fs-extra@8.1.0: wanted: {"node":">=6 <7 || >=8"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine bcrypt@3.0.6: wanted: {"node":">= 6.0.0"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine jsonata@1.6.5: wanted: {"node":">= 6"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine tail@2.0.3: wanted: {"node":">= 6.0.0"} (current: {"node":"4.6.1","npm":"2.15.9"})
-
> bcrypt@3.0.6 install /usr/lib/node_modules/node-red/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 Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v46-linux-arm-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@4.6.1 (node-v46 ABI, unknown) (falling back to source compile with node-gyp) 
Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 13, in 
    import gyp
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in 
    import gyp.input
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in 
    from compiler.ast import Const
ImportError: No module named compiler.ast
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.44-2.7.4+gb1555bf
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/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding" "--node_abi_napi=node-v46" "--napi_build_version=0" "--node_napi_label=node-v46"
gyp ERR! cwd /usr/lib/node_modules/node-red/node_modules/bcrypt
gyp ERR! node -v v4.6.1
gyp ERR! node-gyp -v v3.4.0
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/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding --node_abi_napi=node-v46 --napi_build_version=0 --node_napi_label=node-v46' (1)
node-pre-gyp ERR! stack     at ChildProcess. (/usr/lib/node_modules/node-red/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:829:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.1.44-2.7.4+gb1555bf
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-red/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/node-red/node_modules/bcrypt
node-pre-gyp ERR! node -v v4.6.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.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/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding --node_abi_napi=node-v46 --napi_build_version=0 --node_napi_label=node-v46' (1)
npm WARN optional dep failed, continuing bcrypt@3.0.6
npm WARN engine har-validator@5.1.3: wanted: {"node":">=6"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine readable-stream@3.4.0: wanted: {"node":">= 6"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine punycode@2.1.1: wanted: {"node":">=6"} (current: {"node":"4.6.1","npm":"2.15.9"})
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

Hi @edisonbr and Welcome to the Toradex Community!

Could you provide the version of the Hardware and Software of your module?

Best regards,
Jaski

Hi @edisonbr!

Your image is lacking some dependencies. To compile some Node-RED modules you’re going to need python-compiler and python-multiprocessing, at least.

But note that this is optional. The installer is trying to compile bcrypt, but it’s an optional dependency. You can see at the end of the log that Node-RED is installed and its binary is actually linked.

Best regards,

Gustavo.