Hey all ![]()
Iβve been wanting to create a demo for my Ghost Markdown plugin but I donβt want to create another repo to manage. It would also be cool to use it as a method of testing. Is there a decent approach to this? I tried creating a demo site inside the plugin repo but Iβm getting a somewhat meta issue, I canβt use a plugin inside a project of the same name
.
Hey! Iβve just forked and Iβm not getting any errors in the deploy log. Can you give me a bit more info as to the issue youβre seeing? Cheers!
Hey! Hereβs a copy of my logs on Netlify:
5:02:29 PM: β― Installing plugins
5:02:29 PM: - netlify-plugin-ghost-markdown
5:02:31 PM: β
5:02:31 PM: βββββββββββββββββββββββββββββββ
5:02:31 PM: β Dependencies error β
5:02:31 PM: βββββββββββββββββββββββββββββββ
5:02:31 PM: β
5:02:31 PM: Error message
5:02:31 PM: Error while installing dependencies in /opt/build/repo
5:02:31 PM: npm ERR! code ENOSELF
5:02:31 PM: npm ERR! Refusing to install package with name "netlify-plugin-ghost-markdown" under a package
5:02:31 PM: npm ERR! also called "netlify-plugin-ghost-markdown". Did you name your project the same
5:02:31 PM: npm ERR! as the dependency you're installing?
5:02:31 PM: npm ERR!
5:02:31 PM: npm ERR! For more information, see:
5:02:31 PM: npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
5:02:31 PM: β
5:02:31 PM: npm ERR! A complete log of this run can be found in:
5:02:31 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-04-19T16_02_31_366Z-debug.log
Iβm guessing itβs down to this line in the logs:
Refusing to install package with name βnetlify-plugin-ghost-markdownβ under a package also called βnetlify-plugin-ghost-markdownβ. Did you name your project the same as the dependency youβre installing?
Iβm not necessarily looking to fix my logs, but more find a way to demo my plugin without creating another repo. Iβd like the repo that contains my plugin to also be the source of the demo ![]()
I followed the URL which the log dumped out (https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm).
This can be overridden with the
--forceflag
Youβll want to append this using the NPM_FLAGS env variable, perhaps in netlify.toml over the UI ![]()
Surely it canβt be that simple! Haha thank you @Scott, Iβll give this a go
I tried this @Scott with no luck. I did it very briefly though. I think this is more an issue with the Build Plugins and effectively creating demos for those plugins. I want it to be contained within the repo without creating a whole other project just to demonstrate it. It would be nice to know how to approach this sensibly without creating really unique configurations
Hey David ![]()
If you setup your repo like this: GitHub - DavidWells/netlify-sentry-plugin: WIP - Plugin to automatically run sentry releases you can have a demo site in the same repo.
The netlify-sentry-plugin/test-site at master Β· DavidWells/netlify-sentry-plugin Β· GitHub folder deploys & the plugin itself is just referenced locally netlify-sentry-plugin/netlify.toml at master Β· DavidWells/netlify-sentry-plugin Β· GitHub
So create a new site with your plugin repo using this pattern and you should be good to go.
Ah great thanks David, this is a good reference point. I think Iβm closer, hereβs the latest errors Iβm getting:
10:48:51 AM: Error while installing dependencies in /opt/build/repo
10:48:51 AM: npm ERR! code ENOLOCAL
10:48:51 AM: npm ERR! Could not install from "../index.js" as it does not contain a package.json file.
So itβs locating the file, but not the package.json? It is there though, so maybe it assumes the demo project should have a package file too? This would be counterintuative though as my demo project is a Jekyll site which may never have a package.json.
I wondered if there was a modules issue, so I copied your .gitignore setup but still no change. Hoping to get this resolved so I can get some debugging done and provide a demo on the plugin ![]()
Edit: Looks like it could be related to this bug ![]()
Hi @DavidDarnes,
Yes this is the issue you just pointed at. I will update this post as soon as this is fixed.
Thanks @ehmicky! As long as we know the issue Iβm cool 
Update! Iβve now started cloning the plugin into a folder within the demo. This works with the Netlify CLI locally but not on Netlify itself. Not ideal either but at least allows me to test the plugin in the same project