How to install plugin locally?
-
Hi,
I developed a plugin which communicates with another local system. And I just want to install it locally since it's useless for others.
I found from doc that
“installing” a plugin by placing it in the /plugins folder is still supported. This feature may be deprecated in later versions of NodeBB
So we have to publish it in npm ?
-
@SuperMike You can copy the plugin to the node_modules folder.
-
Thanks @julian , this is definitely the thing I was looking for.
I'm doing 'npm-link' in my custom plugin's folder, then 'npm-link node_modules/myplugin' in the main nodebb folder.
The first command works, but the second gives an error about not being able to find the remote git repo: "fatal: Could not read from remote repository".
Obviously the point is that it's a local-only plugin, so I'm not sure how to get rid of that error!
-
@julian But then I get the following, because it's not looking in the right place for the package.json:
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /usr/bin/nodebb/nodebb-plugin-btcsso/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/usr/bin/nodebb/nodebb-plugin-btcsso/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-05-16T09_24_17_811Z-debug-0.log