'npm install failing when it tries to download dependencies from bitbucket server

When i tried to run npm install command from freestyle job in jenkins It is failing with below error

npm ERR! command-line line 0: unsupported option "accept-new"

I found it is a bug -

[BUG] StrictHostKeyChecking=accept-new causes install failure on OpenSSH <7.6 #31 as per https://github.com/npm/git/issues/31

As a workaround they have mentioned to add

GIT_SSH_COMMAND="ssh" npm install

But after that i'm getting the below error

enter image description here

From detailed log

enter image description here

Could you please suggest how to fix this

freestyle job command as below

enter image description here



Solution 1:[1]

From the error code - EMFILE - hitting ulimit conditions. After increased ulimit using ulimit -n issue got fixed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JPNagarajan