Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 796 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error installing node-gyp on ubuntu

#1
npm http 200

[To see links please register here]

npm http GET

[To see links please register here]

npm http 304

[To see links please register here]


> [email protected] install node_modules/weak
> node-gyp rebuild

Traceback (most recent call last):
File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-15-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the weak package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls weak
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "node" "/usr/bin/npm" "install" "[email protected]"
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.23
npm ERR! code ELIFECYCLE

npm ERR! not ok code 0


I don't have a direct dependency on weak or node-gyp but I guess it is required by my other dependencies (express,phantom,ejs,aws-sdk,moment). Anyone faced such an issue and was able to fix?
Reply

#2

This is what worked. You need python 2.6 during the installation.

#!/bin/bash
#On Ubuntu Saucy:
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10

#you can switch between 2.6 & 2.7 using:
sudo update-alternatives --config python

#Btw I installed node using ppa:chris-lea/node.js




[To see links please register here]

Reply

#3
If your python version isn't the source of error, check if you have "gyp" installed. This is conflicting with the gyp version in node-gyp.

```apt-get remove gyp```

[To see links please register here]

Reply

#4
This command ```sudo apt-get install build-essential``` helped in my case.
Reply

#5
On Ubuntu 10.04, Installing libicu solved my problem.

`sudo apt-get install libicu-dev`
Reply

#6
On Fedora 20, reinstalling gyp fixed this for me.

sudo yum reinstall gyp
Reply

#7
FWIW, I had a similar problem trying to install Protractor on Ubuntu 14.04 (DigitalOcean). Reinstalling node-gyp fixed the it:

apt-get install node-gyp
Reply

#8
I faced this issue on Ubuntu 16.04 while trying to install the wikimedia extension mathoid.

I tried everything that was suggested and nothing worked until I did:

sudo apt-get install librsvg2-2 librsvg2-dev
Reply

#9
I already had `build-essential` installed. I just had to run:

sudo apt install python
Reply

#10
Here are the steps to install node-gyp successfully on a Ubuntu system:

1.First of all, install the "make" build tool in Ubuntu with the following commands:

sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y;
2. Then you need to install the a proper C/C++ compiler toolchain. We will be installing GCC here with the following commands:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-snapshot -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave
/usr/bin/g++ g++ /usr/bin/g++-6 && \
sudo apt-get install gcc-4.8 g++-4.8 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave
/usr/bin/g++ g++ /usr/bin/g++-4.8;
3. Install python 2.7 version. (Note: Python 3 is not supported by node-gyp).

sudo apt update
sudo apt upgrade
sudo apt install python2.7 python-pip
4. And finally install, node-gyp npm package:

npm install -g node-gyp

**Additional but not important:** If you have any atom keyboard-layout related issue with node-gyp then install the following one more package:

sudo apt-get install libxkbfile-dev

Thats all! It should be working fine now.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through