英文:
Strapi v4.9.0 cannot create custom Plugin - not shown in Admin Panel Side Bar
问题
我一直在使用 strapi v4.9.0,并且需要创建一个自定义插件,允许将我的内容类型数据库条目导出为可下载的 CSV 文件。现在,我知道已经存在用于此目的的插件,但我需要创建自己的插件(因为依赖关系等问题)。
我使用 TypeScript 进行编程,并按照这个教程进行操作: https://docs.strapi.io/dev-docs/plugins-development#creating-a-plugin
从图片中可以看到,插件在“插件”下列出。但在管理面板或设置中,我无法“访问”插件。我检查了插件文件夹结构,似乎没有缺少任何内容。我多次重建项目,删除缓存,重新安装 node_modules/,并按照教程在 config/plugins.ts 中注册了插件。
这个问题有人有任何建议吗?
感谢帮助!
英文:
I have been working with strapi v4.9.0 and i need to create a custom plugin which will allow to export my content-type data base entries into a downloadable CSV file. Now, I know that plugins for that already exist, but I need to create my own one (because of dependencies etc. …).
I am programming in typescript and followed this tutorial: https://docs.strapi.io/dev-docs/plugins-development#creating-a-plugin
As you can see in the picture, the plugin is listed under Plugins. But neither in the Admin Side Panel nor in the Settings can I “access” the plugin. I checked the plugin folder structure, and nothing seems to miss.
Also I re-build the project several times, deleted the cache, reinstalled node_modules/ and registered the plugin in config/plugins.ts as shown in the tutorial.
Does someone here has any suggestion as to why I cannot seem to make this work?
Any help is appreciated!
Thanks
Already explained in the original post.
答案1
得分: 1
我遇到了相同的问题,npm
是问题的原因,它在与 strapi 配合时存在问题,删除插件和 strapi 中的 dist 文件夹,还要删除插件和 strapi 中的 package-lock.json,以及 node_modules 文件夹。
然后,使用 yarn 重新安装所有依赖。如果你没有安装 yarn,可以使用 npm i yarn -g
安装,然后重启命令行工具。
首先构建插件,然后构建 strapi,之后可以尝试运行 yarn develop --watch-admin
。
英文:
I had the same issue, npm
was to blame, it has issues with strapi, delete your dist folders from plugin and from strapi, also delete the package-lock.json from plugin and from strapi, and also the node_modules folders.
Install everything again using yarn. If you don't have yarn, install it using npm i yarn -g
, restart the cmd.
Build the plugin firstly and then strapi, then you can try it yarn develop --watch-admin
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论