admin管理员组

文章数量:1122846

I created a new plugin for a WordPress project using @wordpress/scripts in my local environment. After I finished and ran the command npm run plugin-zip it generated the zip file but couldn't be installed on the production, saying:

"The package could not be installed. No valid plugins were found."

The problem is the node_modules folder is so big, and zipping the full plugin and uploading it doesn't feel correct to me. How can I move only the built folder of the plugin to the production site?

I created a new plugin for a WordPress project using @wordpress/scripts in my local environment. After I finished and ran the command npm run plugin-zip it generated the zip file but couldn't be installed on the production, saying:

"The package could not be installed. No valid plugins were found."

The problem is the node_modules folder is so big, and zipping the full plugin and uploading it doesn't feel correct to me. How can I move only the built folder of the plugin to the production site?

Share Improve this question asked Apr 16, 2024 at 17:04 Moussa SaidiMoussa Saidi 113 bronze badges 1
  • I'm currently working on a site where the previous developer included node_modules in the theme and then went even further by dropping their own scripts into sub-directories within... ..makes updating things a nightmare. You should be able to structure your 'build' so that it outputs the finished, compiled plugin into it's own separate folder, so the none of the node.js modules need to be included. – Tony Djukic Commented Apr 24, 2024 at 19:14
Add a comment  | 

1 Answer 1

Reset to default 1

For some reason npm run plugin-zip only ZIP the build file and that's not enough for a plugin.

I created my ZIP file manually by moving the build folder and index.php to a new folder and zip them. And that fixed the issue.

本文标签: How can I use the zip of my plugin in another website