Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

404 when browsing to npm URL



  • We are evaluating your product for a private repository of NuGet and NPM feeds. When creating a new NPM feed, the URL that is presented to the user does not work and produces a 404.

    1. Installed ProGet on Windows 7 machine with IIS and SQL server
    2. Configured Windows Integrated Authentication
    3. Verified that NuGet functionality works fine
    4. Create a new NPM feed called "test-npm-feed"
    5. Pulled a package from an external registry (ex "browserify 8.0.3")
    6. Opened the NPM package in ProGet
    7. Clicked on the "configuring npm" link
    8. Attempted to browse to the following link and received 404

    npm config set registry http://my_machine_name:81/npm/test-npm-feed

    Product: ProGet
    Version: 3.4.0



  • That URL is not meant to be browsed from the web, only the npm client.



  • (I'm working with Marcin on this)

    I would expect it to return some JSON, as in http://registry.npmjs.org/, right? Using the npm client to attempt to do any action after configuring it to use the registry yields:

    npm ERR! registry error parsing json
    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "search"
    npm ERR! node v0.11.14
    npm ERR! npm  v2.1.8
    npm ERR! Unexpected token <
    npm ERR! <!DOCTYPE html>
    npm ERR! <html>
    npm ERR! <head>
    npm ERR!     <title>Request handler not found (404)</title>
    ...
    npm ERR! </body>
    npm ERR! </html>


  • We've done some digging on this, and this seems to be due to a change in a recent version of npm. For some reason, v2.1.8 always makes the search request to /-/all instead of /npm/../-/all, but npm install seems to work correctly. ProGet returns an HTML page because the request URL is not part of the API endpoint.

    Without knowing the rationale behind this change, my best guess is that it's a bug in the npm client, as it looks like there was a major refactor in their codebase involving URL resolution.

    Does the npm install command work correctly?



  • I'll add that the npm search command is a bit outdated; it is considered generally broken at this time:

    See https://github.com/npm/npm/issues/7109



  • And also see this post.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation