FAIL: Update from 1.16.2 to 1.17.1 broken (Ubuntu 18.04.5/node 14.15.3/npm 7.5.4)

Unsolved Technical Support
  • Hi all,
    I updated from nodeBB 1.16.2 to 1.17.1 as I always do, after this doc:

    When I type ./nodebb upgrade in the nodebb folder I get the following error:

    npm ERR! code 1
    npm ERR! path /opt/nodebb/node_modules/sharp
    npm ERR! command failed
    npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
    npm ERR! sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag
    npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
    npm ERR! sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm'
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2021-06-05T15_15_57_043Z-debug.log
    Error installing dependencies!
    message: Command failed: npm install --production
    stdout: null
    stderr: null
    /opt/nodebb/src/cli/package-install.js:81
                    throw e;
                    ^
    
    Error: Command failed: npm install --production
        at checkExecSyncError (child_process.js:616:11)
        at Object.execSync (child_process.js:652:15)
        at Object.installAll (/opt/nodebb/src/cli/package-install.js:72:9)
        at Object.<anonymous> (/opt/nodebb/src/cli/index.js:62:18)
        at Module._compile (internal/modules/cjs/loader.js:1063:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
        at Module.load (internal/modules/cjs/loader.js:928:32)
        at Function.Module._load (internal/modules/cjs/loader.js:769:14)
        at Module.require (internal/modules/cjs/loader.js:952:19)
        at require (internal/modules/cjs/helpers.js:88:18) {
      status: 1,
      signal: null,
      output: [ null, null, null ],
      pid: 27482,
      stdout: null,
      stderr: null
    }
    

    As I understan, the module sharp is missiong.
    I installed it with: npm install sharp --unsafe-perm
    Same error as mentioned before.

    I also see this: Installation error: EACCES: permission denied, mkdir '/root/.npm'

    But this seems to be nonsense by this two means:

    • The folder already exists with drwxrwxr-x 297 root root
    • and it is writable AND executable by root ...

    So what the heck is going on here?
    What did I miss?
    Could anybody please point me into the right direction?
    😇

  • Hi guys,

    its me again 😀
    I am just answering my own question to myself.

    Update should not be done by the root user, but with the user you installed nodeBB.

    NodeBB Upgrade Complete!

    Its that damn easy!
    Have a great day!
    🤗

  • BTW. npm audit give me whole bunch of so called "security issues".
    No, now just one ...

    npm audit fix could not fix these - so how can that be fiexed?
    *puzzled*

    $ npm audit
    # npm audit report
    
    bootbox  *
    Severity: moderate
    Cross-Site Scripting - https://npmjs.com/advisories/882
    No fix available
    node_modules/bootbox
    
    1 moderate severity vulnerability
    
    Some issues need review, and may require choosing
    a different dependency.
    

    Anyone knows what to do here?


Suggested Topics


  • 0 Votes
    7 Posts
    306 Views
  • 0 Votes
    29 Posts
    1984 Views
  • 0 Votes
    9 Posts
    460 Views
  • 0 Votes
    10 Posts
    491 Views
  • 1 Votes
    57 Posts
    18204 Views