-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin not detected when installed globally #13
Comments
The error might depends of your nodejs set up. I would describe more about your environment otherwise the author of this plugin won’t be able to help you. |
Configuration file also helps. |
I use the LTS version of nodejs (v10.13.0) installed with nvm.
|
Hi Rama, I tried it using your config and got the same error using
|
I've inserted a Results with $ verdaccio --config verdaccio.yaml
warn --- config file - D:\Projects\n4bb12\tmp-verdaccio\verdaccio.yaml
tryLoad D:\Tools\node\node_modules\verdaccio\build\plugins\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\plugins\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\plugins\verdaccio-github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\plugins\sinopia-github-oauth-ui
tryLoad verdaccio-github-oauth-ui
tryLoad sinopia-github-oauth-ui
tryLoad github-oauth-ui
error--- plugin not found. try npm install verdaccio-github-oauth-ui
(node:7728) UnhandledPromiseRejectionWarning: Error: "github-oauth-ui" plugin not found
try "npm install verdaccio-github-oauth-ui"
at Object.keys.map.pluginId (D:\Tools\node\node_modules\verdaccio\build\lib\plugin-loader.js:107:13)
at Array.map (<anonymous>)
at loadPlugin (D:\Tools\node\node_modules\verdaccio\build\lib\plugin-loader.js:66:37)
at Auth._loadPlugin (D:\Tools\node\node_modules\verdaccio\build\lib\auth.js:45:39)
at new Auth (D:\Tools\node\node_modules\verdaccio\build\lib\auth.js:35:25)
at defineAPI (D:\Tools\node\node_modules\verdaccio\build\api\index.js:60:16)
at D:\Tools\node\node_modules\verdaccio\build\api\index.js:146:12
at Generator.next (<anonymous>)
at step (D:\Tools\node\node_modules\verdaccio\build\api\index.js:53:191)
at D:\Tools\node\node_modules\verdaccio\build\api\index.js:53:361
(node:7728) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7728) [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. Results with $ verdaccio --config verdaccio.yaml
warn --- config file - D:\Projects\n4bb12\tmp-verdaccio\verdaccio.yaml
tryLoad C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\plugins\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\verdaccio-github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\sinopia-github-oauth-ui
tryLoad verdaccio-github-oauth-ui
warn --- Plugin successfully loaded: github-oauth-ui
tryLoad C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\plugins\audit
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\audit
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\verdaccio-audit
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\sinopia-audit
tryLoad verdaccio-audit
warn --- Plugin successfully loaded: audit
tryLoad C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\plugins\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\verdaccio-github-oauth-ui
tryLoad D:\Projects\n4bb12\tmp-verdaccio\node_modules\sinopia-github-oauth-ui
tryLoad verdaccio-github-oauth-ui
warn --- Plugin successfully loaded: github-oauth-ui
warn --- http address - http://localhost:4873/ - verdaccio/3.8.5 Looks like the directory structure is different when installed with |
Interesting, verdaccio relies on the node algorithm (https://nodejs.org/api/modules.html#loading_from_node_modules_Folders), so there is no rocket science in our side, it should no be distinction over the node package manager tool is being used. The |
I can confirm the plugin works when installed with yarn, thanks! I'm currently using npm v6.4.1 and nvm v0.33.11. Will try using other versions and see if the problem persists. |
According to node docs, if I read the algorithm correctly, global Using global You can, however, add your global Does making it global give you any advantage? You could still just use a Do you have the option to containerize it? Then you could extend the verdaccio docker image: |
I think the algorithm implies that we can't load global modules from locally installed module. But if we used globally installed One thing that interests me is other plugins seems to handle global installation just fine. verdaccio-github-oauth is a good example. I'm setting up verdaccio for a PoC so I installed it globally for the sake of simplicity. I might use local installation or docker later on when I have clearer direction. Btw, installing with yarn has solved my problem so you can close this issue if you like :) |
OK great, will close it then. Glad you got it to work.
Apparently not by default. I tried to point that out with reference to the node docs where the node resolve algorithm is described.
Plugins don't handle installation. They just get Below you can see that ACS@AZEESS MINGW64 /D/Projects/__lab/tmp-verdaccio
$ npm i -g verdaccio verdaccio-github-oauth
D:\Tools\node\verdaccio -> D:\Tools\node\node_modules\verdaccio\bin\verdaccio
+ [email protected]
+ [email protected]
added 7 packages from 5 contributors and updated 1 package in 13.832s
$ verdaccio --config verdaccio.yaml
warn --- config file - D:\Projects\__lab\tmp-verdaccio\verdaccio.yaml
error--- plugin not found. try npm install verdaccio-github-oauth
(node:19492) UnhandledPromiseRejectionWarning: Error: "github-oauth" plugin not found
try "npm install verdaccio-github-oauth"
at Object.keys.map.pluginId (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\lib\plugin-loader.js:106:13) at Array.map (<anonymous>)
at loadPlugin (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\lib\plugin-loader.js:65:37)
at Auth._loadPlugin (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\lib\auth.js:45:39) at new Auth (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\lib\auth.js:35:25)
at defineAPI (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\api\index.js:60:16) at C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\api\index.js:146:12
at Generator.next (<anonymous>) at step (C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\api\index.js:53:191)
at C:\Users\ACS\AppData\Local\Yarn\Data\global\node_modules\verdaccio\build\api\index.js:53:361(node:19492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19492) [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. |
For my future self googling and finding this issue again:
|
Bug Report
Versions
Expected behavior
I am planning to setup a verdaccio server in a VM. I installed verdaccio and verdaccio-github-oauth-ui globally using
npm i -g verdaccio verdaccio-github-oauth-ui
.Observed behaviour
The
github-oauth-ui
plugin is not detected when I tried runningverdaccio
Steps to reproduce
verdaccio
Additional context
The text was updated successfully, but these errors were encountered: