# Namescoped plugins fails to run

**URL:** <https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288>\
**Category:** Kibana\
**Created:** [August 8, 2017, 2:52pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288 "2017-08-08T14:52:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ENG618](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eng618/32/59206_2.png) [@ENG618](https://discuss.elastic.co/u/ENG618)\
**Post date:** [August 8, 2017, 2:52pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288/1 "2017-08-08T14:52:27Z")

</div>

[github issue](https://github.com/elastic/kibana/issues/13221)

I am trying to create a plugin with a name spaced package name (i.e. @\<name-space\>/\<package-name\>). When doing so it is unable to run or be installed. It has to be name scoped so that it can be published to a private npm registry.

It can be built ;however, it just fails to install in a kibana instance.

Has anyone else attempted to create a plugin under there circumstances?

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [August 9, 2017, 8:37pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288/2 "2017-08-09T20:37:06Z")

</div>

I'm surprised to hear that this doesn't work, as far as I can tell there isn't any restriction on what the plugin id can be. What type of error are you getting?

---

<div class="post-metadata">

**Author:** ![ENG618](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eng618/32/59206_2.png) [@ENG618](https://discuss.elastic.co/u/ENG618)\
**Post date:** [August 10, 2017, 12:41pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288/3 "2017-08-10T12:41:07Z")

</div>

When I call `npm run start` from the plugin dir I get the following error

`optmzr log [14:40:50.969] [fatal] Error: ENOENT: no such file or directory, open '/Users/<path to kibana>/optimize/bundles/@<name-space>/<plugin-name>.entry.js`

it's strange because `npm run build` completes sucessful, but if I go to install that plugin (using the official kibana docker image) in a Dockerfile I get the following error, when building the image.

`Retrieving metadata from plugin archive Plugin installation was unsuccessful due to error "No kibana plugins found in archive"`

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [August 10, 2017, 6:40pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288/4 "2017-08-10T18:40:42Z")

</div>

> [@ENG618](#):
>
> o such file or directory, open '/Users/\<path to kibana\>/optimize/bundles/@\<name-space\>/\<plugin-name\>.entry.js

Ah, yeah, that makes sense. There is probably a piece of the installation process that isn't expecting plugins to be nested in a directory. We use [`fs.readdir`](https://github.com/elastic/kibana/blob/master/src/server/plugins/scan.js#L24) to see which plugins are in a `plugins.scanDir` directory, which means that we would find `@namespace` and not the acutal plugin directory. Sorry about that. If you want to play around with the [plugin scanning](https://github.com/elastic/kibana/blob/master/src/server/plugins/scan.js#L24) code you might be able to get it working and I'd be happy to help you get it merged into open source, but it would probably be easier to just rewrite the `name` in your package.json at build time, before uploading an archive.

PS: What benefit do you receive from publishing the package to npm?

---

<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:** [September 7, 2017, 6:40pm UTC](https://discuss.elastic.co/t/namescoped-plugins-fails-to-run/96288/5 "2017-09-07T18:40:43Z")

</div>

Closed on September 7, 2017, 6:40pm UTC

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