Problem when installing XMPP

Hello,
I’m currently having a problem when I try to install the module XMPP. I’ve tried using the console and the interface, but none of them worked.
This message appears on the console:

    [npm-cache] [INFO] [npm] running [npm install]...
      /tmp/shelljs_c84f103a11c07b6890e2:4
        fs.writeFileSync('/tmp/shelljs_cd560880cf12f1f05bb7', err ? err.code.toString() : '0');
                                                                            ^
    
      TypeError: Cannot read property 'toString' of null
          at /tmp/shelljs_c84f103a11c07b6890e2:4:71
          at ChildProcess.exithandler (child_process.js:205:5)
          at emitTwo (events.js:106:13)
          at ChildProcess.emit (events.js:191:7)
          at maybeClose (internal/child_process.js:891:16)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
      shell.js: internal error
      Error: Command failed: "/usr/bin/node" /tmp/shelljs_c84f103a11c07b6890e2
          at checkExecSyncError (child_process.js:472:13)
          at Object.execSync (child_process.js:512:13)
          at execSync (/home/asterisk/.node/lib/node_modules/npm-cache/node_modules/shelljs/src/exec.js:81:11)
          at Object._exec (/home/asterisk/.node/lib/node_modules/npm-cache/node_modules/shelljs/src/exec.js:214:12)
          at Object.exec (/home/asterisk/.node/lib/node_modules/npm-cache/node_modules/shelljs/src/common.js:182:23)
          at CacheDependencyManager.installDependencies (/home/asterisk/.node/lib/node_modules/npm-cache/cacheDependencyManagers/cacheDependencyManager.js:49:13)
          at CacheDependencyManager.loadDependencies (/home/asterisk/.node/lib/node_modules/npm-cache/cacheDependencyManagers/cacheDependencyManager.js:237:18)
          at startManager (/home/asterisk/.node/lib/node_modules/npm-cache/index.js:117:15)
          at /home/asterisk/.node/lib/node_modules/npm-cache/node_modules/async/lib/async.js:181:20
          at Object.async.forEachOf.async.eachOf (/home/asterisk/.node/lib/node_modules/npm-cache/node_modules/async/lib/async.js:233:13)
    
      Finished updating libraries!
      Starting new Xmpp Process...
    
    
        [Symfony\Component\Process\Exception\ProcessFailedException]
        The command "runuser 'asterisk' -c 'cd /var/www/html/admin/modules/xmpp/node/node_modules/lets-chat && mkdir -p /home/asterisk/.pm2
        && mkdir -p /var/www/html/admin/modules/xmpp/node/node_modules/lets-chat/logs && export HOME="/home/asterisk" && export PM2_HOME="/h
        ome/asterisk/.pm2" && export ASTLOGDIR="/var/log/asterisk" && export ASTVARLIBDIR="/var/lib/asterisk" && export PATH="$HOME/.node/bi
        n:$PATH" && export NODE_PATH="$HOME/.node/lib/node_modules:$NODE_PATH" && export MANPATH="$HOME/.node/share/man:$MANPATH" && /var/ww
        w/html/admin/modules/pm2/node/node_modules/pm2/bin/pm2 start /var/www/html/admin/modules/xmpp/node/node_modules/lets-chat/app.js  --
        name '\''xmpp'\'' -e '\''/var/log/asterisk/xmpp_err.log'\'' -o '\''/var/log/asterisk/xmpp_out.log'\'' --merge-logs --log-date-format
         '\''YYYY-MM-DD HH:mm Z'\'''" failed.
        Exit Code: 1(General error)
        Output:
        ================
        Error Output:
        ================
        bash: line 0: cd: /var/www/html/admin/modules/xmpp/node/node_modules/lets-chat: No such file or directory       

Can you guys help me?

fwconsole chown
Reboot
fwconsole ma download xmpp
fwconsole ma install xmpp -f

I did what you said, but I still got the same problem. I’ve already tried reinstalling NodeJS and NPM, but none of this worked.

do you use official distro or your own setup?

have you tried to create the missing directory manually and try to install again?

I use my own setup and yes I tried to create the directory (one of the first things I did)

It’s unable to write a file to the tmp directory. Probably doesn’t have permissions and on top of tag there is no error code to turn into a string. But the real issue is the lack of write permissions on tmp

I tried use fwconsole chown and chmod -R 777 /tmp/ and the problem persists

Do you need this module? You could just skip it.

I don’t need it. Actually, I’d never used this module, I just wanted to test it.