Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-12108

npm@4: searching a hosted repo a second time causes npm error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:
    • Environment:
      (MacOSX)
    • Story Points:
      5

      Description

      While reviewing npm@4, I noticed that I could search hosted repos and find results via the CLI (ie npm search --registry=http://localhost:8081/repository/npm-hosted/ whatever) however, after the first time I was getting an npm error not in the nexus.log but from npm.

      Josephs-MBP:npm jtom$ npm search --registry=http://localhost:8081/repository/npm-hosted/ test
      npm WARN Failed to read search cache. Rebuilding
      npm WARN Building the local index for the first time, please be patient
      NAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS
      testproject1              | Test Project 1       |                 | 2017-01-18 | 0.0.1    |         
      Josephs-MBP:npm jtom$ npm search --registry=http://localhost:8081/repository/npm-hosted/ test
      NAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS
      testproject1              | Test Project 1       |                 | 2017-01-18 | 0.0.1    |         
      npm ERR! Darwin 15.6.0
      npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "search" "--registry=http://localhost:8081/repository/npm-hosted/" "test"
      npm ERR! node v6.9.3
      npm ERR! npm  v4.1.1
      
      npm ERR! premature close
      npm ERR! 
      npm ERR! If you need help, you may report this error at:
      npm ERR!     <https://github.com/npm/npm/issues>
      npm ERR! Darwin 15.6.0
      npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "search" "--registry=http://localhost:8081/repository/npm-hosted/" "test"
      npm ERR! node v6.9.3
      npm ERR! npm  v4.1.1
      
      npm ERR! invalid value written to input stream
      npm ERR! 
      npm ERR! If you need help, you may report this error at:
      npm ERR!     <https://github.com/npm/npm/issues>
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /Users/jtom/Documents/Work/temp/npm/npm-debug.log
      

      Of note:
      1) Resultant searches do show results (see above) before the error. However, searches with no results JUST show the error which is confusing. Marked minor because of this.
      2) If you clear the cache (ie sudo rm -R ~/.npm) first this error does not occur.

      This occurs in npm 4.0.0, 4.1.1 and 4.1.2. It does not occur in 3.10.3. I actually misanalyzed it as not occurring in 4.0.0 because I went from 3.10.3 to 4.0.0 without clearing cache (see #2 above). This may be why this has not been seen much in the field.

      I did not check older NX3 or NX2 at this time, however, because it's an npm CLI command, I doubt it'd make much difference. I can check if desired.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jtom Joe Tom
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title