Search This Blog

Breaking

Wednesday, 26 August 2020

Fix: npm install fibers shows error while doing npm install for your webdriverio UI automation project

 This is one issue that irritates me every time when I try to do node js setup for webdriverIO automation project in my mac. This issue comes when you try to do npm install in your command prompt for installing the node packages specified in your package.json. 


So the issue is: When you try to run npm install, then it fails with below error:

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! fibers@3.1.1 install: `node build.js || nodejs build.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the fibers@3.1.1 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.    

npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\deepak\AppData\Roaming\npm-cache\_logs\2019-05-07T10_36_05_651Z-debug.log

or 

> fibers@1.0.1 install /usr/local/lib/node_modules/fibers

> node ./build.js


gyp ERR! build error 

gyp ERR! stack Error: not found: make

gyp ERR! stack     at F    (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)

gyp ERR! stack     at E    (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)

gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16

gyp ERR! stack     at Object.oncomplete (fs.js:107:15)

gyp ERR! System Darwin 12.5.0

gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-             


gyp.js" "rebuild"

gyp ERR! cwd /usr/local/lib/node_modules/fibers

gyp ERR! node -v v0.10.29

gyp ERR! node-gyp -v v0.13.1

gyp ERR! not ok 

Build failed

npm ERR! fibers@1.0.1 install: `node ./build.js`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the fibers@1.0.1 install script.

npm ERR! This is most likely a problem with the fibers package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     node ./build.js

npm ERR! You can get their info via:

npm ERR!     npm owner ls fibers

npm ERR! There is likely additional logging output above.


npm ERR! System Darwin 12.5.0

npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "fibers@1.0.1" "-g"

npm ERR! cwd /Users/mac/Documents/node/node-fibers

npm ERR! node -v v0.10.29

npm ERR! npm -v 1.4.14

npm ERR! code ELIFECYCLE

npm ERR!  

npm ERR! Additional logging details can be found in:

npm ERR!     /Users/mac/Documents/node/node-fibers/npm-debug.log

npm ERR! not ok code 0




To fix this issue, you need to check, which node version, you are running in your machine.

You can check it by doing:


node -v


In my case, it was showing some 12 versions of the node.


I googled and found that it was working with the node 11 version.


So, I try to keep both versions in my machine as some of my local projects were using node 12.


To do this, I used nvm. nvm helps you to keep different node packages and allow you to switch between them.


To install nvm in mac, you need to run this command in your terminal:


curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash


Check installed nvm version by:


nvm --version


Now install node 11 


nvm install 11.14.0


and use it in your project:


nvm use 11.14.0 


After this, run:


 npm install 


Now, it will install without giving any error.



No comments:

Post a Comment