# NPX is giving npm ERR! cb.apply is not a function when making gz and br files

**URL:** <https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285>\
**Category:** Kibana\
**Created:** [June 8, 2021, 10:19am UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285 "2021-06-08T10:19:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammadawaisjavaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammadawaisjavaid/32/60807_2.png) [@mohammadawaisjavaid](https://discuss.elastic.co/u/mohammadawaisjavaid)\
**Post date:** [June 8, 2021, 10:19am UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285/1 "2021-06-08T10:19:09Z")

</div>

Whenever I try to run the following command to customize ELK 7.10.0  
`npx gzip-cli /usr/share/kibana/x-pack/plugins/security/target/public/security.chunk.4.js -e=gz -e=b`  
I got the following error.  
npm ERR! cb.apply is not a function  
I am using the following versions:  
node js : v16.3.0  
npm : 7.15.1  
npx : 10.2.2

Please any one from this community guide me that how to resolve this error. Help will be appreciated

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [June 8, 2021, 7:27pm UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285/2 "2021-06-08T19:27:02Z")

</div>

> [@mohammadawaisjavaid](#):
>
> npm ERR! cb.apply is not a function

Delete the npm folder and if there is one npm cache folder.  
Run npm clean cache —force ( — force is now required to clean cache)

or

Delete the npm folder and if there is one mom cache folder.  
Run npm clean cache —force ( — force is now required to clean cache)  
Make sure everything to do with Nodejs is deleted and uninstalled.  
Reinstall Nodejs.

Try it and let us know if it works ...

cc @jbudz - for more inputs if any ?

thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![mohammadawaisjavaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammadawaisjavaid/32/60807_2.png) [@mohammadawaisjavaid](https://discuss.elastic.co/u/mohammadawaisjavaid)\
**Post date:** [June 9, 2021, 4:05am UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285/3 "2021-06-09T04:05:16Z")

</div>

I have tried the workaround that you have posted above but It does not works for me as When I again installed nodejs then It gave me the same error like before that cb.apply is not a function. I am using UBUNTU 18.04. Any other work around? if yes then please do share

Thanks  
Mohammad Awais Javaid

---

<div class="post-metadata">

**Author:** ![mohammadawaisjavaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammadawaisjavaid/32/60807_2.png) [@mohammadawaisjavaid](https://discuss.elastic.co/u/mohammadawaisjavaid)\
**Post date:** [June 11, 2021, 5:18am UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285/4 "2021-06-11T05:18:43Z")

</div>

I have overcome this issue by executing the following using nvm.

curl -o- [https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh](https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh) | bash  
source ~/.bashrc  
nvm install 8.10.0  
nvm --version  
npm i -g npx  
nvm install 10.24.0

I think 10.24.0 version matches with 7.10.0 dependencies. This solution worked for me and I am using UBUNTU 18.04.

---

<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:** [July 9, 2021, 5:19am UTC](https://discuss.elastic.co/t/npx-is-giving-npm-err-cb-apply-is-not-a-function-when-making-gz-and-br-files/275285/5 "2021-07-09T05:19:32Z")

</div>

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