semver.simplifyRange is not a function

I’m trying to update Joplin for some time now, but I always encounter the following issue:

4444 http fetch GET 200 114ms (cache miss)
4445 timing metavuln:packument:glob-stream Completed in 116ms
4446 notice 
4446 notice New minor version of npm available! 7.17.0 -> 7.19.1
4446 notice Changelog:
4446 notice Run npm install -g npm@7.19.1 to update!
4446 notice 
4447 verbose stack TypeError: semver.simplifyRange is not a function
4447 verbose stack     at Advisory.[calculateRange] (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:191:16)
4447 verbose stack     at Advisory.load (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:148:28)
4447 verbose stack     at Calculator.[calculate] (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js:59:14)
4447 verbose stack     at async Promise.all (index 8)
4447 verbose stack     at async Map.[init] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:180:7)
4447 verbose stack     at async (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:108:7)
4448 verbose cwd /var/cache/private/pamac/joplin/src/joplin-1.8.5
4449 verbose Linux 5.10.49-1-MANJARO
4450 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--cache" "/var/cache/private/pamac/joplin/src/npm-cache"
4451 verbose node v12.22.0
4452 verbose npm  v7.17.0
4453 error semver.simplifyRange is not a function
4454 verbose exit 1
$ npm list -g
+-- asar@3.0.3
+-- npm@7.19.1
`-- semver@7.3.5

Any help would be appreciated. Thanks! :slightly_smiling_face:

I’ve learned that npm should be downgraded to v6 in order to use Joplin.
How could I do it safely in Manjaro?

Instead of using a global installation of node - I recommend using a node version manager.

One such version manager is nvm.

1 Like

Thanks for the heads up. I installed node v14 & npm v6 by using nvm and switched to it, but the error is still the same.

$ node -v || node --version
$ npm --version

By looking at the logs, during installation of Joplin, it still mentions the npm v7.17.0-1 which was installed via pamac:

I have noticed there’s another npm that I tried to install whilst struggling with Joplin in my ~/.npm-global installed with the -g switch.

I know this may be critical for my system and I kindly ask for your guidance (to avoid bricking my Manjaro) - what would be a clean and safe way to reduce those 2 redundant versions of npm/node and keep only the one I just installed via nvm?

Just checking versions:
[pvonbert@frydo bash]$ whereis npm
npm: /usr/bin/npm /usr/share/man/man1/npm.1.gz
npm -v 7.20.0
node -v v16.4.2

npm is this bash script:

#!/usr/bin/env node

and my last joplin installation did also:
[2021-07-17T17:12:39-0400] [ALPM] installed joplin-desktop (2.1.7-1)
[2021-07-17T17:03:55-0400] [ALPM] installed jq (1.6-4)
[2021-07-17T17:03:55-0400] [ALPM] installed oniguruma (

I don’t know if any of this will help you or muddy the waters more

Joplin is in the AUR (Arch User Repository).

$ whereis npm
npm: /usr/bin/npm /home/jazz/.nvm/versions/node/v14.17.3/bin/npm /usr/share/man/man1/npm.1.gz

$ npm -v
$ node -v

$ /usr/bin/npm -v
$ /usr/bin/node -v   
$ /usr/bin/npm list --depth=0
joe@ /home/jazz
+-- @mapbox/node-pre-gyp@1.0.1
`-- semver@7.3.5

jq and oniguruma installed (same versions)

The only difference is that I have multiple npm installed: one is my /usr/bin and the other one in my /home dir via nvm. I tried to delete the /home instance, but there was no improvements. Still the semvers issue. I guess I should not uninstall the one in /usr/bin and install it again, since it may be required by the system?

I’m just trying to decipher why other Manjaro users report they can install Joplin, but I can’t replicate it due to an unknown issue with semver. Even more confusing is that the devs of Joplin claim it can’t be built against npm v7.x, whilst others claim they can.

SemVer 7.3.5 and jq version 1.6 installed but not oniguruma.

$ npm list -g
β”œβ”€β”€ node-gyp@8.1.0
β”œβ”€β”€ nopt@5.0.0
β”œβ”€β”€ npm@7.20.0
└── semver@7.3.5


$ tree -l -L 2 ~/.npm
β”œβ”€β”€ _cacache
β”‚ β”œβ”€β”€ content-v2
β”‚ β”œβ”€β”€ index-v5
β”‚ └── tmp
β”œβ”€β”€ eresolve-report.txt
β”œβ”€β”€ _logs
β”‚ β”œβ”€β”€ 2021-07-16T21_11_19_664Z-debug.log
β”‚ β”œβ”€β”€ 2021-07-16T21_12_45_450Z-debug.log
β”‚ β”œβ”€β”€ 2021-07-16T21_14_08_537Z-debug.log
β”‚ β”œβ”€β”€ 2021-07-16T21_21_04_190Z-debug.log
β”‚ β”œβ”€β”€ 2021-07-17T14_33_39_010Z-debug.log
β”‚ β”œβ”€β”€ 2021-07-17T21_19_34_846Z-debug.log
β”‚ └── 2021-07-17T21_20_21_887Z-debug.log
└── _update-notifier-last-checked

npm -h comments a .npmrc file, which I do not have.

But apart from this, I couldn’t see anything else, sorry Jazz.

Hi Jazz, today there was an update of Joplin to:
Joplin 2.2.1 (prod, linux)

Client ID: 3fcdf7b15183478b9a2342dce86bxxxx
Sync Version: 2
Profile Version: 39
Keychain Supported: No
Revision: bf3f461 (master)
If interested I can send you the output of yay

1 Like

Yes, please. I would prefer pamac (if possible), thank you.

I believe this is my main issue that affects hits, so I’ll open another one here (since the definition of the original problem described on top of this page may be misleading):

At least one of the following commands helped me to install joplin-desktop:

$ nvm cache clear
$ nvm exec npm audit fix
$ nvm exec npm install semver
$ pamac install joplin-desktop

I just read your post. Interesting. I mess so much my system that usually I have to clean install it once a year. Maybe that’s why it’s so different!?

$ which npm

$ npm --version

$ whereis npm
npm: /usr/bin/npm /usr/share/man/man1/npm.1.gz

$ which node

[$ whereis node
node: /usr/bin/node /usr/include/node /usr/share/man/man1/node.1.gz

And nvm is not installed
$ whereis nvm

But at least you got Joplin installed, there is always a way (in Linux) :upside_down_face:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.