Unsolved Upgrade to 2.x from 1.9.8


  • Hello,

    I have a problem when trying to upgrade from 1.9.8 to 2.x.
    Seems to miss something but i dont' understand what is messing up (since i follow nodebb for a long time and have upgraded several times without problem).

    It seems that npm install --production is problematic

    When i do the ./nodebb upgrade (after the git stuff: fetch / reset master / checkout), i get :

    npm WARN config production Use `--omit=dev` instead.
    
    
    2022-10-20T09:00:05.587Z [4500,4501,4502,4503,4504,4505,4506,4507/9323] - error: uncaughtException: Command failed: npm install --production
    Error: Command failed: npm install --production
        at checkExecSyncError (node:child_process:861:11)
        at Object.execSync (node:child_process:932:15)
        at Object.pkgInstall.installAll (/opt/nodebb/src/cli/package-install.js:129:9)
        at Object.handler (/opt/nodebb/src/cli/upgrade.js:22:19)
        at runSteps (/opt/nodebb/src/cli/upgrade.js:55:16)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async Object.runUpgrade [as upgrade] (/opt/nodebb/src/cli/upgrade.js:85:3) {"date":"Thu Oct 20 2022 11:00:05 GMT+0200 (Central European Summer Time)","error":{"output":[null,null,null],"pid":9388,"signal":null,"status":1,"stderr":null,"stdout":null},"exception":true,"os":{"loadavg":[0.92,0.32,0.17],"uptime":47638.6},"process":{"argv":["/usr/bin/node","/opt/nodebb/nodebb","upgrade"],"cwd":"/opt/nodebb","execPath":"/usr/bin/node","gid":1001,"memoryUsage":{"arrayBuffers":147130,"external":4348502,"heapTotal":26439680,"heapUsed":19879232,"rss":65306624},"pid":9323,"uid":1001,"version":"v16.18.0"},"stack":"Error: Command failed: npm install --production\n    at checkExecSyncError (node:child_process:861:11)\n    at Object.execSync (node:child_process:932:15)\n    at Object.pkgInstall.installAll (/opt/nodebb/src/cli/package-install.js:129:9)\n    at Object.handler (/opt/nodebb/src/cli/upgrade.js:22:19)\n    at runSteps (/opt/nodebb/src/cli/upgrade.js:55:16)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async Object.runUpgrade [as upgrade] (/opt/nodebb/src/cli/upgrade.js:85:3)","trace":[{"column":11,"file":"node:child_process","function":"checkExecSyncError","line":861,"method":null,"native":false},{"column":15,"file":"node:child_process","function":"Object.execSync","line":932,"method":"execSync","native":false},{"column":9,"file":"/opt/nodebb/src/cli/package-install.js","function":"Object.pkgInstall.installAll","line":129,"method":"installAll","native":false},{"column":19,"file":"/opt/nodebb/src/cli/upgrade.js","function":"Object.handler","line":22,"method":"handler","native":false},{"column":16,"file":"/opt/nodebb/src/cli/upgrade.js","function":"runSteps","line":55,"method":null,"native":false},{"column":5,"file":"node:internal/process/task_queues","function":"processTicksAndRejections","line":96,"method":null,"native":false},{"column":3,"file":"/opt/nodebb/src/cli/upgrade.js","function":"async Object.runUpgrade [as upgrade]","line":85,"method":"runUpgrade [as upgrade]","native":false}]}
    

    Thanks in advance for your help.

  • GNU/Linux Admin

    What happens when you run npm i again?


  • Hello,

    Thanks @julian for your answer.
    Seems to have some dependancies problems on nodebb-plugin-emoji-apple.
    Tried to uninstall all references with npm uninstall + web admin without success (got the error).

    Here are the logs when upgrading

    [email protected]:~# service nodebb stop
    [email protected]:~# su - nodebb
    $ git fetch
    remote: Enumerating objects: 806, done.
    remote: Counting objects: 100% (767/767), done.
    remote: Compressing objects: 100% (262/262), done.
    remote: Total 806 (delta 525), reused 733 (delta 504), pack-reused 39
    Receiving objects: 100% (806/806), 305.15 KiB | 5.98 MiB/s, done.
    Resolving deltas: 100% (528/528), completed with 49 local objects.
    From https://github.com/NodeBB/NodeBB
       98be042012..65284c142a  v1.19.x                                     -> origin/v1.19.x
       34439c06de..8c6cc7bee8  bootstrap5                                  -> origin/bootstrap5
       eec683dd39..248fd6721c  develop                                     -> origin/develop
       e7d0040d17..c2024f3484  master                                      -> origin/master
     + 4a5f10d2ab...032ca0f118 renovate/mongodb-4.x                        -> origin/renovate/mongodb-4.x  (forced update)
     * [new branch]            renovate/nodebb-plugin-composer-default-9.x -> origin/renovate/nodebb-plugin-composer-default-9.x
     * [new branch]            renovate/postgres-15.x                      -> origin/renovate/postgres-15.x
       3509ed9461..5836bf4a05  v2.x                                        -> origin/v2.x
     * [new tag]               v1.19.10-beta.5                             -> v1.19.10-beta.5
     * [new tag]               v2.5.6                                      -> v2.5.6
     * [new tag]               v2.5.7                                      -> v2.5.7
    $ git checkout v2.x
    Branch 'v2.x' set up to track remote branch 'v2.x' from 'origin'.
    Switched to a new branch 'v2.x'
    $ git reset --hard origin/v2.x
    HEAD is now at 5836bf4a05 chore: incrementing version number - v2.5.7
    $ npm i
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    
    added 431 packages, and audited 1388 packages in 12s
    
    141 packages are looking for funding
      run `npm fund` for details
    
    19 vulnerabilities (2 low, 6 moderate, 11 high)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues possible (including breaking changes), run:
      npm audit fix --force
    
    Some issues need review, and may require choosing
    a different dependency.
    
    Run `npm audit` for details.
    $ ./nodebb upgrade
    Dependencies outdated or not yet installed.
    Installing them now...
    
    npm WARN config production Use `--omit=dev` instead.
    npm WARN ERESOLVE overriding peer dependency
    npm WARN While resolving: [email protected]
    npm WARN Found: [email protected]
    npm WARN node_modules/nodebb-plugin-emoji
    npm WARN   [email protected]"4.0.6" from the root project
    npm WARN   3 more (nodebb-plugin-emoji-android, ...)
    npm WARN 
    npm WARN Could not resolve dependency:
    npm WARN peer [email protected]"^3.4.2 || ^3.5.0" from [email protected]
    npm WARN node_modules/nodebb-plugin-emoji-apple
    npm WARN   [email protected]"^2.0.5" from the root project
    npm WARN ERESOLVE overriding peer dependency
    npm WARN While resolving: [email protected]
    npm WARN Found: [email protected]
    npm WARN node_modules/nodebb-plugin-emoji
    npm WARN   [email protected]"4.0.6" from the root project
    npm WARN   3 more (nodebb-plugin-emoji-android, ...)
    npm WARN 
    npm WARN Could not resolve dependency:
    npm WARN peer [email protected]"^3.0.0" from [email protected]
    npm WARN node_modules/nodebb-plugin-emoji-twemoji-v2
    npm WARN   [email protected]"^2.0.1" from the root project
    
    added 127 packages, removed 38 packages, changed 118 packages, and audited 1064 packages in 41s
    
    90 packages are looking for funding
      run `npm fund` for details
    
    14 vulnerabilities (2 low, 2 moderate, 10 high)
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues possible (including breaking changes), run:
      npm audit fix --force
    
    Some issues need review, and may require choosing
    a different dependency.
    
    Run `npm audit` for details.
    OK
    
    
    Updating NodeBB...
    
    1. Updating package.json file with defaults...  OK
    
    2. Bringing base dependencies up to date...  started
    npm WARN config production Use `--omit=dev` instead.
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/nodebb-plugin-emoji
    npm ERR!   [email protected]"4.0.6" from the root project
    npm ERR!   peer [email protected]"^4.0.1" from [email protected]
    npm ERR!   node_modules/nodebb-plugin-emoji-android
    npm ERR!     [email protected]"3.0.0" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer [email protected]"^3.4.2 || ^3.5.0" from [email protected]
    npm ERR! node_modules/nodebb-plugin-emoji-apple
    npm ERR!   [email protected]"^2.0.5" from the root project
    npm ERR! 
    npm ERR! Conflicting peer dependency: [email protected]
    npm ERR! node_modules/nodebb-plugin-emoji
    npm ERR!   peer [email protected]"^3.4.2 || ^3.5.0" from [email protected]
    npm ERR!   node_modules/nodebb-plugin-emoji-apple
    npm ERR!     [email protected]"^2.0.5" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR! 
    npm ERR! See /opt/nodebb/.npm/eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /opt/nodebb/.npm/_logs/2022-10-20T12_20_26_678Z-debug-0.log
    Error installing dependencies!
    message: Command failed: npm install --production
    stdout: null
    stderr: null
    Error occurred during upgrade: Error: Command failed: npm install --production
        at checkExecSyncError (node:child_process:861:11)
        at Object.execSync (node:child_process:932:15)
        at Object.pkgInstall.installAll (/opt/nodebb/src/cli/package-install.js:129:9)
        at Object.handler (/opt/nodebb/src/cli/upgrade.js:22:19)
        at runSteps (/opt/nodebb/src/cli/upgrade.js:55:16)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async Object.runUpgrade [as upgrade] (/opt/nodebb/src/cli/upgrade.js:85:3)
    2022-10-20T12:20:29.257Z [4500,4501,4502,4503,4504,4505,4506,4507/9285] - error: uncaughtException: Command failed: npm install --production
    Error: Command failed: npm install --production
        at checkExecSyncError (node:child_process:861:11)
        at Object.execSync (node:child_process:932:15)
        at Object.pkgInstall.installAll (/opt/nodebb/src/cli/package-install.js:129:9)
        at Object.handler (/opt/nodebb/src/cli/upgrade.js:22:19)
        at runSteps (/opt/nodebb/src/cli/upgrade.js:55:16)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async Object.runUpgrade [as upgrade] (/opt/nodebb/src/cli/upgrade.js:85:3) {"date":"Thu Oct 20 2022 14:20:29 GMT+0200 (Central European Summer Time)","error":{"output":[null,null,null],"pid":9351,"signal":null,"status":1,"stderr":null,"stdout":null},"exception":true,"os":{"loadavg":[1.01,0.33,0.17],"uptime":11972.77},"process":{"argv":["/usr/bin/node","/opt/nodebb/nodebb","upgrade"],"cwd":"/opt/nodebb","execPath":"/usr/bin/node","gid":1001,"memoryUsage":{"arrayBuffers":135097,"external":4348502,"heapTotal":27156480,"heapUsed":19464704,"rss":66793472},"pid":9285,"uid":1001,"version":"v16.18.0"},"stack":"Error: Command failed: npm install --production\n    at checkExecSyncError (node:child_process:861:11)\n    at Object.execSync (node:child_process:932:15)\n    at Object.pkgInstall.installAll (/opt/nodebb/src/cli/package-install.js:129:9)\n    at Object.handler (/opt/nodebb/src/cli/upgrade.js:22:19)\n    at runSteps (/opt/nodebb/src/cli/upgrade.js:55:16)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async Object.runUpgrade [as upgrade] (/opt/nodebb/src/cli/upgrade.js:85:3)","trace":[{"column":11,"file":"node:child_process","function":"checkExecSyncError","line":861,"method":null,"native":false},{"column":15,"file":"node:child_process","function":"Object.execSync","line":932,"method":"execSync","native":false},{"column":9,"file":"/opt/nodebb/src/cli/package-install.js","function":"Object.pkgInstall.installAll","line":129,"method":"installAll","native":false},{"column":19,"file":"/opt/nodebb/src/cli/upgrade.js","function":"Object.handler","line":22,"method":"handler","native":false},{"column":16,"file":"/opt/nodebb/src/cli/upgrade.js","function":"runSteps","line":55,"method":null,"native":false},{"column":5,"file":"node:internal/process/task_queues","function":"processTicksAndRejections","line":96,"method":null,"native":false},{"column":3,"file":"/opt/nodebb/src/cli/upgrade.js","function":"async Object.runUpgrade [as upgrade]","line":85,"method":"runUpgrade [as upgrade]","native":false}]}
    $
    

  • @arnaudw try this

    npm remove nodebb-plugin-emoji-apple
    ./nodebb upgrade
    npm install nodebb-plugin-emoji-apple
    

    @julian we should probably pass the "ignore peer dependencies" flag to npm, in the package install and upgrade paths at least


  • @PitaJ said in Upgrade to 2.x from 1.9.8:

    npm install nodebb-plugin-emoji-apple

    Thanks @PitaJ, it worked.
    i need to uninstall another one : nodebb-plugin-emoji-twemoji

    Now i can't reinstall them (but not really important) :

    $ npm install nodebb-plugin-emoji-apple
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/nodebb-plugin-emoji
    npm ERR!   [email protected]"4.0.6" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer [email protected]"^5.0.0" from [email protected]
    npm ERR! node_modules/nodebb-plugin-emoji-apple
    npm ERR!   [email protected]"*" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR! 
    npm ERR! See /opt/nodebb/.npm/eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /opt/nodebb/.npm/_logs/2022-10-20T16_31_10_813Z-debug-0.log
    
  • GNU/Linux Admin

    @PitaJ if you open a PR it can count for your t-shirt this month 😂


  • @arnaudw try installing the previous major version:

    npm install [email protected]
    

  • Thanks again @PitaJ, it works now 🙂


  • @arnaudw I upgraded my twemoji fork earlier today, so that should work now if you install it again


Suggested Topics

| | | |