Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-24793

NPM install/publish (scoped) not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:
      None
    • Severity:
      High

      Description

      Artifactory version: jfrog-artifactory-pro-6.23.7-62307900

       

      .npmrc content: 

      @myorg:registry=http://artifactory.example.com:8081/artifactory/api/npm/test-npm/
      //artifactory.example.com:8081/artifactory/api/npm/test-npm/:_password=XXXXXXXXXX
      //artifactory.example.com:8081/artifactory/api/npm/test-npm/:username=myuser
      //artifactory.example.com:8081/artifactory/api/npm/test-npm/:email=usr@example.com
      //artifactory..example.com:8081/artifactory/api/npm/test-npm/:always-auth=true

       

      $ npm publish
      npm notice 
      npm notice � @myorg/test-nodejslib@0.0.0
      npm notice === Tarball Contents === 
      npm notice 1.7kB package.json
      npm notice 1.0kB README.md 
      npm notice === Tarball Details === 
      npm notice name: @myorg/test-nodejslib 
      npm notice version: 0.0.0 
      npm notice package size: 1.2 kB 
      npm notice unpacked size: 2.7 kB 
      npm notice shasum: 3fe18cf9e33cccb9a9c7ff3c1456da2e96ada0b2
      npm notice integrity: sha512-OA2tA0DPudrWB[...]GjtJWPrvC2RUw==
      npm notice total files: 2 
      npm notice 
      npm ERR! code E404
      npm ERR! 404 Not Found - PUT http://artifactory.example.com:8081/artifactory/api/npm/test-npm-local/@myorg%2ftest-nodejslib
      npm ERR! 404 
      npm ERR! 404 '@myorg/test-nodejslib@0.0.0' is not in the npm registry.
      npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
      npm ERR! 404 
      npm ERR! 404 Note that you can also install from a
      npm ERR! 404 tarball, folder, http url, or git url.
      

       

      $ npm install @myorg/test-nodejslib --loglevel verbose
      npm info it worked if it ends with ok
      npm verb cli [
      npm verb cli '/usr/bin/node',
      npm verb cli '/usr/bin/npm',
      npm verb cli 'install',
      npm verb cli '@myorg/test-nodejslib',
      npm verb cli '--loglevel',
      npm verb cli 'verbose'
      npm verb cli ]
      npm info using npm@6.14.10
      npm info using node@v14.15.4
      npm verb npm-session 1af7e9ee027eb7d4
      npm http fetch GET 404 http://artifactory.example.com:8081/artifactory/api/npm/test-npm/@myorg%2ftest-nodejslib 116ms
      npm http fetch GET 404 http://artifactory.example.com:8081/artifactory/api/npm/test-npm/@myorg%2ftest-nodejslib 32ms
      npm timing stage:rollbackFailedOptional Completed in 1ms
      npm timing stage:runTopLevelLifecycles Completed in 2375ms
      npm verb stack Error: 404 Not Found - GET http://artifactory.example.com:8081/artifactory/api/npm/test-npm/@myorg%2ftest-nodejslib - not_found
      npm verb stack at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:117:15
      npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
      npm verb statusCode 404
      npm verb pkgid @myorg/test-nodejslib@latest
      npm verb Linux 4.9.0-14-amd64
      npm verb argv "/usr/bin/node" "/usr/bin/npm" "install" "@myorg/test-nodejslib" "--loglevel" "verbose"
      npm verb node v14.15.4
      npm verb npm v6.14.10
      npm ERR! code E404
      npm ERR! 404 Not Found - GET http://artifactory.example.com:8081/artifactory/api/npm/test-npm/@myorg%2ftest-nodejslib - not_found
      npm ERR! 404 
      npm ERR! 404 '@myorg/test-nodejslib@latest' is not in the npm registry.
      npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
      npm ERR! 404 
      npm ERR! 404 Note that you can also install from a
      npm ERR! 404 tarball, folder, http url, or git url.
      npm verb exit [ 1, true ]
      npm timing npm Completed in 2819ms

       

      request.log

      20210202174053|2|REQUEST|131.154.4.204|myuser|GET|/api/npm/test-npm/@myorg%2ftest-nodejslib|HTTP/1.1|404|0
      20210202174053|1|REQUEST|131.154.4.204|myuser|GET|/api/npm/test-npm/@myorg%2ftest-nodejslib|HTTP/1.1|404|0

       

      Artifactory is not running behind a reverse proxy

       

      As reported here https://www.jfrog.com/confluence/display/RTF6X/npm+Registry, tomcat is running with ALLOW_ENCODED_SLASH=true (default config)

       

      $ARTIFACTORY_HOME/etc/default:

       

      export JAVA_OPTIONS="$JAVA_OPTIONS -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=rpm -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom"

       

       

      tomcat process (partial output):

      -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom -Dartifactory.home=/var/opt/jfrog/artifactory -Dignore.endorsed.dirs= -classpath /opt/jfrog/artifactory/tomcat/bin/bootstrap.jar:/opt/jfrog/artifactory/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/jfrog/artifactory/tomcat -Dcatalina.home=/opt/jfrog/artifactory/tomcat -Djava.io.tmpdir=/opt/jfrog/artifactory/tomcat/temp org.apache.catalina.startup.Bootstrap start 
      
      

       

      Tried a "Not scoped" setup and works properly.

        

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bovy89 Stefano Bovina
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Sync Status

                Connection: RTFACT Sync
                RTMID-24793 -
                SYNCHRONIZED
                • Last Sync Date: