NPM publish scoped artifact returns in 400 Bad Request (OD-2134)
empinator opened 1 year ago

when trying to publish my npm scoped package, a 400 is returned

{
  "publishConfig": {
    "registry": "https://dev-hub.domain.de/_pro/build-tools/~npm/"
  },
  "repository": "https://dev-hub.domain.de/_pro/build-tools",
  "name": "@pro/build-tools2",
  "version": "3.1.4",
  ...
}
$ npm publish
...
npm ERR! 400 Bad Request - PUT https://dev-hub.domain.de/_pro/build-tools/~npm/@pro%2fbuild-tools2 - Invalid request path

with an unscoped package it works without problems

if I adjust the name of the package to be scoped within the database in order to be fetchable, the same problem occurs

{
    ...
    "devDependencies": {
        "@pro/build-tools2": "3.1.4",    
        ...
     }
     ...
}
$ npm install
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://dev-hub.domain.de/_pro/build-tools/~npm/@pro%2fbuild-tools2 - Invalid request path

any advice would be appreciated

  • Robin Shen commented 1 year ago

    This works at my side. Can you please create a test project running the npm publish step demonstrating the issue?

  • empinator commented 1 year ago

    I am sorry. After some investigation I figured out, that nginx was manipulation the request path, therefore leading to the seen error

    According to this post I had to remove the trailing slash, after that it was working

    https://docs.onedev.io/administration-guide/reverse-proxy-setup

        location / {
                proxy_pass http://localhost:6610/;
        }
    

    =>

        location / {
                proxy_pass http://localhost:6610;
        }
    
  • empinator changed state to 'Closed' 1 year ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 1 year ago

    Thanks for the investigation. Doc has been updated to reflect this.

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2134
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover