Struggling to Diagnose "Error: Invalid tag name '>=^16.0.0'"

I’m building the mediasoup-demo on the v3 branch, after cloning it to my local system. I’m using npm version 7.6.2.

The server builds fine if I do npm i in /server, but I’m getting this error when I cd into app and try to do npm i there.

136 timing command:i Completed in 4723ms
137 verbose stack Error: Invalid tag name ">=^16.0.0": Tags may not have any characters that encodeURIComponent encodes.
137 verbose stack     at invalidTagName (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:94:15)
137 verbose stack     at fromRegistry (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:299:13)
137 verbose stack     at Function.resolve (/usr/local/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:84:12)
137 verbose stack     at Arborist.[nodeFromEdge] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:899:37)
137 verbose stack     at async Arborist.[loadPeerSet] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1107:23)
137 verbose stack     at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:838:11)
137 verbose stack     at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:209:7)
137 verbose stack     at async Promise.all (index 1)
137 verbose stack     at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
137 verbose stack     at async Install.install (/usr/local/lib/node_modules/npm/lib/install.js:120:5)
138 verbose cwd /Users/akm/mediasoup-demo/app
139 verbose Darwin 19.6.0
140 verbose argv "/usr/local/Cellar/node/15.10.0/bin/node" "/usr/local/bin/npm" "i"
141 verbose node v15.10.0
142 verbose npm  v7.6.2
143 error code EINVALIDTAGNAME
144 error Invalid tag name ">=^16.0.0": Tags may not have any characters that encodeURIComponent encodes.

I tried finding an occurrence of ">=16.0.0" in the project, via GitHub and my local system, but couldn’t find where that exists.

Is this an issue with my version of npm?


Since this is my first post on the forum I would like to take the opportunity to say thanks to everyone who contributes to the discussion and the project :pray:

arborist or npa is not present in mediasoup-demo. It must be something in your local setup.

1 Like

I see - I didn’t set my current system up for development, so there may be some issues there as a result.

I’ll be trying to fix this over the weekend - will first try a different version of npm to see if that helps (this is because, after some Googling, I found that Arborist “is the dependency tree manager for npm, new in npm v7”).

If that doesn’t work, I’ve got other additional reasons to reset my system, so I’ll try that as well.

You can use npm install --legacy-peer-deps.

Ref: [BUG] Some packages can no longer be installed with npm v7 · Issue #1734 · npm/cli · GitHub

i got the same problem when try npm i gulp with node 14, this helps!