Upgrade from v1.12.2 to v1.13.2 fails because of bootswatch dependency

Technical Support
  • Hi all,

    Running ./nodebb upgrade I get the following:

    Dependencies outdated or not yet installed.
    Installing them now...
    npm ERR! code 128
    npm ERR! Command failed: git clone --mirror -q git://github.com/thomaspark/bootswatch.git /root/.npm/_cacache/tmp/git-clone-969f95f2/.git
    npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-969f95f2/.git'
    npm ERR! 

    I'm aware of the following issue and did try the suggested workaround in this comment: https://github.com/NodeBB/NodeBB/issues/7967#issuecomment-541572134

    To no avail. 😞

    So the hash doesn't work for me despite https://github.com/thomaspark/bootswatch/pull/916#issuecomment-540655426

    Is there a way to circumvent this and upgrade to the latest?

    Any pointers highly appreciated, thanks in advance!

  • Am I really the only one with this issue??!!??

  • You should not be installing or running NodeBB as root. You should not be running npm as root, that is what is causing your issue.

  • @PitaJ How embarrassing 😬 It didn't even come to my mind but now that I could "do the right thing" and re-install, the issue is indeed gone and I could update normally.
    Thanks for your help!

  • Hey,I ran into this problem as well.
    But I can't get it by "run NodeBB as root".What exactly does it mean?
    I got it partially fixed by switching package.json to ""bootswatch": "^4.5.0"" instead of github mirror.But it seems that bootswatch skin is no longer available.The error log says that nodeBB requires some ".less" files in bootswatch module.However,version 4.5 bootswatch contains only ".scss" files.
    Can someone please tell me how can I fix it? Many thanks.

  • @Azurepulse that version of bootswatch is not compatible with nodebb. The error above occurs because you're attempting to run npm as a privileged user "root" or with sudo.

    You need to instead install and run nodebb, all git and npm commands, as a regular user.

  • @PitaJ For example,I ran "nodebb setup" as non-root user on CentOS7,and it stopped and said “insufficient privileges” 企业微信截图_1591856057678.png
    I tried to install it both on Windows and CentOs.I never ran node command as an Administrator on Windows,but still can't do.
    Is there any way I can install a ".less" version of bootswatch manually?
    Also,should it failed,it has nothing to do with Theme plugins right?

  • I have no idea why you wouldn't have access to run node as a different user. How did you install node?

    You either have to do everything as root/sudo or nothing.

    What issues are you having on Windows? What guides are you using for installation?

  • @PitaJ I installed node as sudo. So I had to install everything as a non-sudo user,including mongodb/node right?
    Exactly same issue on windows.I simply ran "nodebb setup",not as an Administrator,then it got stucked.The error log says it couldn't fetch bootswatch git mirror because of invalid arguments.

  • Installing node, mongo, and nginx as sudo should be fine, sorry for the confusing implication. But when you install NodeBB, you should be cloning it into an unprivileged directory, running git with an unprivileged user, and running all ./nodebb commands as an unprivileged user as well.

    Please provide the exact error that you see when installing on windows.

  • Here's the complete error log occurs on Windows.
    Log text:
    Dependencies outdated or not yet installed.
    Installing them now...

    npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of iss
    ues. Please, upgrade your dependencies to the actual version of core-js@3.
    npm ERR! code 128
    npm ERR! Command failed: git clone --mirror -q git://github.com/thomaspark/bootswatch.git C:\Users\huawei\AppData\Roaming\npm
    -cache_cacache\tmp\git-clone-3825054a.git --config core.longpaths=true
    npm ERR! warning: templates not found in C:\Users\huawei\AppData\Local\Temp\pacote-git-template-tmp\git-clone-fd3314bb
    npm ERR! fatal: read error: Invalid argument
    npm ERR! fatal: early EOF
    npm ERR! fatal: index-pack failed
    npm ERR!

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\huawei\AppData\Roaming\npm-cache_logs\2020-06-13T03_49_30_961Z-debug.log
    Error installing dependencies!
    message: Command failed: npm install --production
    stdout: null
    stderr: null
    throw e;

    Error: Command failed: npm install --production
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at Object.installAll (D:\Coding\Web_Project\NodeBB-v1.14.x\src\cli\package-install.js:63:9)
    at Object.<anonymous> (D:\Coding\Web_Project\NodeBB-v1.14.x\src\cli\index.js:60:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 552,
    stdout: null,
    stderr: null

    I suppose I can just forbid users from changing skins to bypass this error.

Suggested Topics