Plugin development not working in 5.0.0

I try to develop a new plugin running this command: npx @strapi/sdk-plugin:init my-strapi-plugin

but get this error message

npm error code ENOENT
npm error syscall open
npm error path /Users/XXX/Developer/repos/project/backend/@strapi/sdk-plugin:init/package.json
npm error errno -2
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/Users/XXX/Developer/repos/project/backend/@strapi/sdk-plugin:init/package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /Users/XXX/.npm/_logs/2024-09-21T17_38_26_561Z-debug-0.log

the documentation doesn’t seem to be up to date - also, I can’t seem to be able to run strapi in watch mode as any changes on my plugin (that I managed to create by running npx @strapi/sdk-plugin my-strapi-plugin instead) are not reflected when running strapi develop --watch-admin (as strapi-plugin watch does not work, yielding an error)

This topic has been created from a Discord post (1287344683793514557) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

1 Like

run it like this: npx @strapi/sdk-plugin init my-strapi-plugin so without the :. That worked for me. I assume the : is a typo

thanks <@207617280325058562> . And how do you handle plugin development ? As I mentionned, watch mode does not work for me…

So I created a new strapi project from scratch strapi-plugin-development.
In that project I ran the plugin init command. I then opened a new terminal went into the plugin folder most likely stapi-plugin-develpment/src/plugins/my-plugin, in there I think is a script npm run watch:link double check that in the package.json. That outputs a command that you should run in your other terminal that is inside the strapi-plugin-development to link the 2.

You do need that yalc package installed globally

and that just worked for me