Skip to content

[BUG](libnpmpublish) Unpublish url not correctly defined #4253

Description

@ychailler

Hello,

When unpublishing a package into an internal repository (such as artifactory) where the registry contains a path, the tarballUrl bellow (unpublish.js:71) will be wrong as it will contain the full registry path

const tarballUrl = url.parse(dist.tarball).pathname.substr(1)

Example :

C:>npm unpublish my-app@1.0-SNAPSHOT --verbose --force --registry https://artifactory.example.com/api/npm/npm-snapshots/
npm info it worked if it ends with ok
npm verb cli [ 'C:\Tools\node-v10.16.3-win-x64\node.exe',
npm verb cli 'C:\Tools\node-v10.16.3-win-x64\node_modules\npm\bin\npm-cli.js',
npm verb cli 'unpublish',
npm verb cli 'my-app@1.0-SNAPSHOT',
npm verb cli '--verbose',
npm verb cli '--force',
npm verb cli '--registry',
npm verb cli 'https://artifactory.example.com/api/npm/npm-snapshots/' ]
npm info using npm@6.9.0
npm info using node@v10.16.3
npm WARN using --force I sure hope you know what you are doing.
npm verb npm-session 501f69ac7af05ab3
npm http fetch GET 200 https://artifactory.example.com/api/npm/npm-snapshots/my-app?write=true 372ms
npm http fetch PUT 200 https://artifactory.example.com/api/npm/npm-snapshots/my-app/-rev/1-0 44ms
npm http fetch GET 304 https://artifactory.example.com/api/npm/npm-snapshots/my-app?write=true 93ms
npm http fetch DELETE 200 https://artifactory.example.com/api/npm/npm-snapshots/api/npm/npm-snapshots/my-app/-/my-app-1.0-SNAPSHOT.tgz/-rev/1-0 79ms
-my-app@1.0-SNAPSHOT
npm verb exit [ 0, true ]
npm timing npm Completed in 5982ms
npm info ok

The last DELETE fetch is wrong the registry path has been duplicated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issuews:libnpmpublishRelated to the libnpmpublish workspace.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions