Home
Support Forums

Plugin internal error - Error: Could not import plugin - Cannot find module

I’m having an issue with missing modules…

site name: vonage-deved-platform
fail: https://app.netlify.com/sites/vonage-deved-platform/deploys/5f9d25ea36465600073f2cd3

I have this plugin and a local plugin to install:

[[plugins]]
  package = "@netlify/plugin-functions-install-core"

[[plugins]]
  package = "/netlify-plugins/algolia-export"
    [plugins.inputs]
      exclude = ['''^\/(?!blog\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/(?!index.html)).*''']

(the later based of a plugin I had in the plugins repo but have since removed for the official Algolia plugin)

If I deploy and the modules are cached, it doesn’t run the postinstall from my main package.json, and then I seem to receive missing module errors.

"postinstall": "cd netlify-plugins/algolia-export && npm install"

If I clear cache & deploy it works, I assume because it then does the post-install from my package.json. I understood this was the purpose of @netlify/plugin-functions-install-core?

I had some trouble finding a good answer for this based on the question I was asking. But I have found it, and it was a RTFM issue. However searching Google pointed me at similar but not related issues in the community. Hoping this will help that.

If you’re using local plugins rather than packaged plugins, you need to include this in your netlify.toml.

[[plugins]]
  package = "@netlify/plugin-local-install-core"
1 Like

Hi @lukeoliff,

Thanks for posting back the solution to this problem.
Please let us know if you have any additional question.

1 Like