'Updating local cordova plugin, but cordova-cli is trying to fetch from npm?

I have a locally-developed cordova plugin in a directory a couple of levels above the level of an application that uses, i.e. the file system structure is:

(root folder)
     |
     +----- app-group-name
     |            |
     |            +---- app-cordova-project
     |            |
     |            +---- app-backend-project
     |
     +----- local-plugin-name
                  |
                  +---- plugin-project
                  |
                  +---- plugin-test-app-project

The location of the root folder varies (I need to be able to develop on this project in multiple operating systems, including both Windows and MacOS, so cannot have the same root folder name in all installations, thus I must use relative paths).

I added the plugin to the project using the cli, thus:

cordova plugin add ../../local-plugin-name/plugin-project --save

This installed the plugin, and added a reference to the config.xml containing a link to the project location. This location was converted to an absolute path name, so I manually edited it back to a relative path.

When the plugin changes, I remove and readd it to the project. I have done this a few times, and it has always worked in the past. However, the most recent time I tried this I got the following error:

(node:14156) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/app-cordova-project
npm ERR! 404
npm ERR! 404  'app-cordova-project' 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 ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myusername\AppData\Roaming\npm-cache\_logs\2018-01-09T22_35_17_444Z-debug.log
(node:14156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

(names changed to protect the innocent. but specifically note that the module it's trying to download is the app's name, not the plugin that's being worked on)

Note that I have recently reinstalled all the various software I'm using (i.e. have new versions of node.js, cordova-cli, git, npm, etc), so it could be a software update that has triggered this. I note specifically that cordova-cli has had a major version update since I last reinstalled it, and that while I'm using the LTS version of node, that also has undergone a major revision since last updated.

Any ideas what's causing this problem, and how I can get my local plugin to reinstall cleanly?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source