Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Dependencies information in NPM registry saved with "^[object Object]" value #746

Closed
peterblazejewicz opened this issue Feb 22, 2020 · 1 comment · Fixed by #753
Closed

Comments

@peterblazejewicz
Copy link
Contributor

The @types/plotly.js information in the NPM registry for version 1.44.29 contains invalid value for the @types/d3 dependency, resulting in CLI rejecting installation (npm i ...)
DefinitelyTyped/DefinitelyTyped#42558

The NPM rejects with an error:

npm i -D @types/plotly.js@1.44.29
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "^[object Object]": Tags may not have any characters that encodeURIComponent encodes.

failing part (under "1.44.29" key):

"scripts": {},
      "dependencies": {
        "@types/d3": "^[object Object]"
      },
      "typesPublisherContentHash": "3fd04840487acbd17ef1ae52264f6d1ba7db198e89954e56773f8ebbd1ca1d14",
      "typeScriptVersion": "2.8",
      "_id": "@types/plotly.js@1.44.29",

the raw info can be seen here:
https://registry.npmjs.org/@types%2fplotly.js

I think publisher code can reuse NPM check to validate entry in the relevant place:

if (encodeURIComponent(spec) !== spec) {
      throw invalidTagName(spec)
    }

where spec is a semver value for the package.

Thanks!

@hediet
Copy link
Member

hediet commented Feb 24, 2020

It does work when pinning the plotly types to 1.44.28 though (1.44.29 is most recent).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants