# Unable to update node\_modules in kibana(version 7.15.1) source code

**URL:** <https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146>\
**Category:** Kibana\
**Created:** [February 14, 2022, 1:36pm UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146 "2022-02-14T13:36:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mridul.chandel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mridul.chandel/32/101797_2.png) [@mridul.chandel](https://discuss.elastic.co/u/mridul.chandel)\
**Post date:** [February 14, 2022, 1:36pm UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/1 "2022-02-14T13:36:03Z")

</div>

I made some changes in the date picker provided by Elasticsearch EUI library inside kibana node\_modules folder. Specifically to these path :-

1. node\_modules@elastic\eui\es\components\date\_picker\super\_date\_picker\relativeOptions.js
2. node\_modules@elastic\eui\es\components\date\_picker\super\_date\_picker\super\_date\_picker.js

But when I run it locally using the command "bin\Elasticsearch.bat", the changes are not reflected in the kibana GUI. Not able to find any useful resource, please help.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [February 22, 2022, 5:23pm UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/2 "2022-02-22T17:23:36Z")

</div>

Hi @mridul.chandel

welcome to the Kibana community.

If you've found any bug or issue in the date picker I'd recommend to fill an issue on the [EUI github repository](https://github.com/elastic/eui).

As for the specific question, in the hypothesis you are testing a fix for kibana, the right folder to apply the fix is the `lib` folder rather than the `es`. Note that you'll lose everything in there on the first reinstall, so perhaps an fix/enhancement request issue on the EUI repo would be best.

---

<div class="post-metadata">

**Author:** ![mridul.chandel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mridul.chandel/32/101797_2.png) [@mridul.chandel](https://discuss.elastic.co/u/mridul.chandel)\
**Post date:** [February 26, 2022, 5:59am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/3 "2022-02-26T05:59:59Z")

</div>

Thanks @Marco_Liberati for the reply.

I tried making changes to the **lib** folder but in vain.

Let me explain my problem further and the steps I follow to make changes.

I downloaded the production build of Elasticsearch and Kibana (version 7.15.1), running them locally using the commands bin\Elasticsearch.bat and bin\kibana.bat respectively.

I want to make some customization to the Kibana date time filter(EUI Super Date Picker) according to the need of my company. The specific changes I made : -

1. node\_modules@elastic\eui\lib\components\date\_picker\super\_date\_picker\relativeOptions.js

```auto
var relativeOptions = [{
  text: 'Seconds ago',
  value: 's'
}, {
  text: 'Minutes ago',
  value: 'm'
}, {
  text: 'Hours ago',
  value: 'h'
}, {
  text: 'Days ago',
  value: 'd'
}, {
  text: 'Weeks ago',
  value: 'w'
}, {
  text: 'Months ago',
  value: 'M'
},
// Commented this code
// {
// text: 'Years ago',
// value: 'y'
// },
{
  text: 'Seconds from now',
  value: 's+'
}, {
  text: 'Minutes from now',
  value: 'm+'
}, {
  text: 'Hours from now',
  value: 'h+'
}, {
  text: 'Days from now',
  value: 'd+'
}, {
  text: 'Weeks from now',
  value: 'w+'
}, {
  text: 'Months from now',
  value: 'M+'
},
// Commented this code
// {
// text: 'Years from now',
// value: 'y+'
// }
];

```

1. node\_modules@elastic\eui\lib\components\date\_picker\super\_date\_picker\super\_date\_picker.js

```auto
function isRangeInvalid(start, end) {
  if (start === 'now' && end === 'now') {
    return true;
  }

  var startMoment = _datemath.default.parse(start);

  var endMoment = _datemath.default.parse(end, {
    roundUp: true
  });

  if (!startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid()) {
    return true;
  }
  
  if (startMoment.isAfter(endMoment)) {
    return true;
  }
  
  // Added this code
  if(endMoment.diff(startMoment, "days") > 365) {
    return true
  }

  return false;
}

```

After making these changes, I re-run Elasticsearch and Kibana but changes are not reflected in the Kibana GUI. I don't know whether I'm making some mistakes or missing some steps. Please help me out on this. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [February 28, 2022, 8:18am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/4 "2022-02-28T08:18:52Z")

</div>

If you want to limit time range for kibana users, another option without changing the code could be to use a [filtered alias](https://discuss.elastic.co/t/restrict-time-range-for-users-in-kibana/251371/2) .

---

<div class="post-metadata">

**Author:** ![mridul.chandel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mridul.chandel/32/101797_2.png) [@mridul.chandel](https://discuss.elastic.co/u/mridul.chandel)\
**Post date:** [March 5, 2022, 11:14am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/5 "2022-03-05T11:14:33Z")

</div>

@Marco_Liberati, the code changes that I had given in my previous comment are some of the many changes that I need to make in the node modules. Can you please suggest how can I make changes in the node modules and reflect them in the kibana GUI.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [March 7, 2022, 8:16am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/6 "2022-03-07T08:16:33Z")

</div>

How did you install kibana?

---

<div class="post-metadata">

**Author:** ![mridul.chandel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mridul.chandel/32/101797_2.png) [@mridul.chandel](https://discuss.elastic.co/u/mridul.chandel)\
**Post date:** [March 12, 2022, 1:55am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/7 "2022-03-12T01:55:37Z")

</div>

@Marco_Liberati As told in one of my previous comment, I had downloaded the production build of Elasticsearch and Kibana and running them using bin\Elasticsearch.bat and bin\kibana.bat respectively. After making changes in the node\_modules of kibana, I again run bin\kibana.bat but changes are not reflected.

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [March 16, 2022, 9:44am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/8 "2022-03-16T09:44:10Z")

</div>

If you didn't install it from source then all changes will be ignored I suspect.  
Best approach here would be to make some enhancement requests on kibana for the requested changes, rather than change dependencies code locally.

---

<div class="post-metadata">

**Author:** ![mridul.chandel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mridul.chandel/32/101797_2.png) [@mridul.chandel](https://discuss.elastic.co/u/mridul.chandel)\
**Post date:** [March 18, 2022, 7:02am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/9 "2022-03-18T07:02:26Z")

</div>

@Marco_Liberati Can you please elaborate "installation from source". In my case I downloaded the zip of Elasticsearch and kibana from the official page and run it according to the instructions specified such as bin\Elasticsearch.bat and bin\kibana.bat.

---

<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:** [April 15, 2022, 7:02am UTC](https://discuss.elastic.co/t/unable-to-update-node-modules-in-kibana-version-7-15-1-source-code/297146/10 "2022-04-15T07:02:40Z")

</div>

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