deno icon indicating copy to clipboard operation
deno copied to clipboard

Error in parsing version dependency for an expression

Open ammubhave opened this issue 1 year ago • 3 comments

Version: Deno 2.0.0

In a freshly initialized deno project run deno add npm:@vercel/[email protected]. OR add @vercel/[email protected] to package.json and run deno install.

The following error is thrown

error: Error in @vercel/[email protected] parsing version requirement for dependency "@opentelemetry/api-logs": ">=0.46.0 && <1.0.0"

Caused by:
    0: Invalid version requirement
    1: Unexpected character.
         >=0.46.0 && <1.0.0
         ~

ammubhave avatar Oct 11 '24 22:10 ammubhave

I guess this is going to be a problem in general with compatibility. looks like node-semver's loose mode throws away any invalid parts (&& being invalid here). where as deno strictly conforms to be bnf.

ammubhave avatar Oct 11 '24 23:10 ammubhave

I recently had the same issue, If you want to reproduce:

git clone https://github.com/belgattitude/workshop-node-sql-server.git
cd workshop-node-sql-server
deno install

Output

error: Error in @vercel/[email protected] parsing version requirement for dependency "@opentelemetry/sdk-logs": ">=0.46.0 && <1.0.0"

Caused by:
    0: Invalid version requirement
    1: Unexpected character.
         >=0.46.0 && <1.0.0
         ~

belgattitude avatar Oct 16 '24 21:10 belgattitude

A different example:

error: Error in [email protected] parsing version requirement for dependency: react@>=16, <=18

Invalid npm version requirement. Unexpected character.
  >=16, <=18
  ~

Caused by:
    0: Invalid npm version requirement. Unexpected character.
         >=16, <=18
         ~
    1: Unexpected character.
         >=16, <=18
         ~

j2ghz avatar Oct 16 '24 21:10 j2ghz