Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11744

`cordova plugin add` does not honor npm registry defined globally

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 6.3.1
    • None
    • cordova-lib
    • Windows 7 x64
      Node 5.1.0
      cordova 6.3.1
      (Also tried using cordova-lib directly; same issue)

    Description

      We have a private NPM registry, configured at the system level (i.e. C:\Program Files\nodejs\node_modules\npm\npmrc. Attempting to install plugins with the registry defined here fails as it tries to hit the public NPM registry:

      C:\Users\IGEN261\code\uit\test\6-hwc\dist\hwc\cordova-project-android>cordova plugin add private-plugin@2.0.5 -d
      No scripts found for hook "before_plugin_add".
      Calling plugman.fetch on plugin "private-plugin@2.0.5"
      Fetching plugin "private-plugin@2.0.5" via npm
      Error: CordovaError: Failed to fetch plugin private-plugin@2.0.5 via registry.
      Probably this is either a connection problem, or plugin spec is incorrect.
      Check your connection and plugin name/version/URL.
      Error: Registry returned 404 for GET on https://registry.npmjs.org/private-plugin
          at C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:192:33
          at _rejected (C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:797:24)
          at C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:823:30
          at Promise.when (C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1035:31)
          at Promise.promise.promiseDispatch (C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:741:41)
          at C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
          at flush (C:\Users\IGEN261\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
          at doNTCallback0 (node.js:430:9)
          at process._tickCallback (node.js:359:13)
      

      My config:

      >npm config list
      ; cli configs
      long = true
      user-agent = "npm/3.3.12 node/v5.1.0 win32 x64"
      
      ; userconfig C:\Users\IGEN261\.npmrc
      progress = true
      
      ; builtin config undefined
      registry = "http://privaterepo.com"
      

      A workaround is to re-specify the registry in my userconfig .npmrc but plugman should honor the registry when it's set at the global level.

      Attachments

        Activity

          People

            vladimir.kotikov Vladimir Kotikov
            mattdsteele Matt Steele
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: