# Getting Module not found error after installing plugin

**URL:** <https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786>\
**Category:** Kibana\
**Created:** [November 26, 2020, 2:46pm UTC](https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786 "2020-11-26T14:46:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveer](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@praveer](https://discuss.elastic.co/u/praveer)\
**Post date:** [November 26, 2020, 2:46pm UTC](https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786/1 "2020-11-26T14:46:08Z")

</div>

Hi Team,

I am working on 7.10.0 kibana. I have created a custom plugin and after deploying it was getting ssl certificate error. To solve that i had installed "ssl-root-cas" using this package I am adding required certificate and create httpsAgent and use it in my apis as shown below.

```auto
  var rootCas = require('ssl-root-cas').create();

  rootCas.addFile(certificatepath);

  require('https').globalAgent.options.ca = rootCas;

  const https = require('https');
  const http = require('http');
  const httpsAgent = useHttps ? new https.Agent({
    rejectUnauthorized: true,
    ca: rootCas
  }) : new http.Agent({});

```

When I test the app locally it works fine, but after creating build and installing the plugin, it gives error - "Error: Cannot find module 'ssl-root-cas'"

below is my package.json file.

```auto
{
  "name": "correlationapp",
  "version": "7.10.0",
  "private": true,
  "scripts": {
    "build": "yarn plugin-helpers build",
    "plugin-helpers": "node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  },
  "dependencies": {
    "moment": "^2.24.0",
    "ssl-root-cas": "^1.3.1"
  }
}

```

Regards  
Praveer.

---

<div class="post-metadata">

**Author:** ![clintandrewhall](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clintandrewhall/32/45435_2.png) [@clintandrewhall](https://discuss.elastic.co/u/clintandrewhall)\
**Post date:** [November 27, 2020, 9:31pm UTC](https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786/2 "2020-11-27T21:31:55Z")

</div>

Good afternoon, Praveer!

First, can you confirm the package you're referencing is in the `node-modules` folder of your plugin?

Second, can you confirm you're using the latest process for building your plugin:

> **[Plugin tooling | Kibana Guide \[7.10\] | Elastic](https://www.elastic.co/guide/en/kibana/current/plugin-tooling.html#_build_plugin_distributable)**

---

<div class="post-metadata">

**Author:** ![praveer](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@praveer](https://discuss.elastic.co/u/praveer)\
**Post date:** [November 30, 2020, 6:25am UTC](https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786/3 "2020-11-30T06:25:28Z")

</div>

Hi @clintandrewhall,

Yes the package is present in node-modules

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d96345e22473570d93e7360037485c79a8e738ec.png)

I went through the link you had shared to create the build & yes i have followed the same methods.

Regards  
Praveer.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 28, 2020, 6:25am UTC](https://discuss.elastic.co/t/getting-module-not-found-error-after-installing-plugin/256786/4 "2020-12-28T06:25:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
