'module' object has no attribute 'script_main'
tj opened this issue · 46 comments
all the addons are exploding for some reason:
> bcrypt@0.7.7 install /home/ubuntu/projects/api/node_modules/bcrypt
> node-gyp rebuild
Traceback (most recent call last):
File "/usr/local/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/local/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-12-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/projects/api/node_modules/bcrypt
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! bcrypt@0.7.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.7 install script.
npm ERR! This is most likely a problem with the bcrypt 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:
version info:
node-gyp@0.12.1 /usr/local/lib/node_modules/node-gyp
node@0.10.22
python 2.7.5+
Hmmm, I haven't seen this. Seems like a borked gyp install somehow. Perhaps try re-installing?
I can confirm that this is a valid error, and we've tried reinstalling multiple times. Here is our log, running on an Amazon cloud instance:
[root@tools ds]# npm install bcrypt
npm WARN package.json expect.js@0.2.0 No repository field.
info trying registry request attempt 1 at 19:10:26
http GET https://registry.npmjs.org/bcrypt/0.7.4
http 304 https://registry.npmjs.org/bcrypt/0.7.4
info trying registry request attempt 1 at 19:10:27
http GET https://registry.npmjs.org/bindings/1.0.0
http 304 https://registry.npmjs.org/bindings/1.0.0
> bcrypt@0.7.4 install /some/folder/node_modules/bcrypt
> 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.4.62-53.42.amzn1.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /some/folder/node_modules/bcrypt
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! bcrypt@0.7.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.4 install script.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.4.62-53.42.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "bcrypt"
npm ERR! cwd /some/folder
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.15
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /some/folder/npm-debug.log
npm ERR! not ok code 0
Any ideas? :-/
probably just a funky package manager install, I'll try from source or sth tomorrow
@visionmedia Is this using the debian nodejs package or something?
@TooTallNate I'm sorry to keep intruding, but I just wanted to point out that the error I posted was generated by a server using Yum's EPEL package manager on a RedHat-based Amazon image, installed using yum install nodejs
. Attempts to use the npm
version of node-gyp
were fruitless, as I believe that the yum
-installed node-gyp
is used by default. It is weird, though, because our other servers haven't had any issues with it. To be honest, we're not utilizing dependency version locking nearly as well as we should be (npm shrinkwrap
et al), so this could very easily be a breaking change in the API of any one of those dependencies.
That last part is purely speculation, of course, and not very helpful, but I wanted to provide as much feedback as possible.
Edit: I am not sure how much it helps, if at all, but I noticed something weird when running npm -g list
:
npm ERR! invalid: inherits@2.0.0 /usr/lib/node_modules/inherits@2
npm ERR! not ok code 0
Subsequent attempts to npm -g update
were not helpful. Though now that I'm thinking about it, I am not sure when last we cleared the npm cache. I'm going to try that and see what happens.
Edit 2: Nope, npm cache clean
didn't help. Even ran npm -g install inherits
and it didn't fix the dependency bug. I am now completely in agreement with @visionmedia on this one, it seems to be a dependency bug somewhere. @TooTallNate if you need more info about the machine that created this error or anything else, please let me know so I can help get this resolved. :)
Edit 3: For what it's worth, the server in question is running Python version 2.6.8
.
Hello,
I got the exact same error trying to install libxmljs 0.8.1, on node 0.10.22 and python 2.7 on ubuntu 13.10.
~/.npm/libxmljs/0.8.1/package$ make
node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.1
gyp info using node@0.10.22 | linux | x64
gyp info spawn python
gyp info spawn args [ '/home/mbailly/Documents/perso/node-0.10.22/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/mbailly/.npm/libxmljs/0.8.1/package/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/mbailly/Documents/perso/node-0.10.22/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/mbailly/.node-gyp/0.10.22/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/mbailly/.node-gyp/0.10.22',
gyp info spawn args '-Dmodule_root_dir=/home/mbailly/.npm/libxmljs/0.8.1/package',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
Traceback (most recent call last):
File "/home/mbailly/Documents/perso/node-0.10.22/lib/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 (/home/mbailly/Documents/perso/node-0.10.22/lib/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-13-generic
gyp ERR! command "node" "/home/mbailly/Documents/perso/node/bin/node-gyp" "configure"
gyp ERR! cwd /home/mbailly/.npm/libxmljs/0.8.1/package
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
make: *** [build] Erreur 1
Please help !
yeah the package manager ones seem pretty borked
yup re-install worked for me, so I guess just don't ever use the package managers haha
For me it got fixed by replacing python2.7 by python2.6. As per https://code.google.com/p/gyp/source/browse/trunk/DEPS#19 , it seems that gyp depends on python 2.6
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
I hope this helps somebody.
@laithshadeed Thanks, it solved the issue for me..
@laithshadeed Also repaired my build on Linux mint 16 :) Thanks was driving me crazy!
Also just hit this on windows: in my case it was because I had a globally installed gyp version which was conflicting with the one inside node-gyp. I found my global install with python -c 'import gyp; print gyp.__file__'
and removing it fixed the problem.
@springmeyer same to me. I just removed gyp to solve this problem.
I have installed node using sudo apt-get install nodejs
suso apt-get install libexpat1-dev
sudo npm install node-expat
Same Issue
root@abul-VirtualBox:~/node-xmpp-bosh# sudo npm install node-expat
npm WARN package.json eventpipe@0.0.5 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json jsdom@0.2.19 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json node-lumberjack@0.0.4 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm http GET https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/node-expat
> node-expat@2.0.0 install /root/node-xmpp-bosh/node_modules/node-expat
> 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.5.0-17-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node-xmpp-bosh/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-expat@2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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 node-expat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "node-expat"
npm ERR! cwd /root/node-xmpp-bosh
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/node-xmpp-bosh/npm-debug.log
npm ERR! not ok code 0
Using node-gyp
@0.11.X on a fresh ubuntu 13.10 install works just fine (at least for node-expat
).
I'm seeing the same error. Downgrading to Python 2.6.x fixed it. @laithshadeed Thanks.
This might occur on Ubuntu based systems if you have installed gyp i.e. sudo apt-get install gyp
Try removing it then trying npm install again
I was originally getting the error above, but changed to python 2.6 as suggested, and now I'm getting this different error:
$ npm install
npm WARN package.json vows@0.5.11 No repository field.
npm http GET https://registry.npmjs.org/bcrypt/0.7.3
npm http 304 https://registry.npmjs.org/bcrypt/0.7.3
npm http GET https://registry.npmjs.org/bindings/1.0.0
npm http 304 https://registry.npmjs.org/bindings/1.0.0
> bcrypt@0.7.3 install /home/james/Projects/Greatvines/cube/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory `/home/james/Projects/Greatvines/cube/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::GenerateSalt(const v8::Arguments&)’:
../src/bcrypt_node.cc:257:74: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
uv_queue_work(uv_default_loop(), req, GenSaltAsync, GenSaltAsyncAfter);
^
In file included from /home/james/.node-gyp/0.10.24/src/node.h:61:0,
from ../src/bcrypt_node.cc:31:
/home/james/.node-gyp/0.10.24/deps/uv/include/uv.h:1432:15: error: initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
^
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Encrypt(const v8::Arguments&)’:
../src/bcrypt_node.cc:337:74: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
uv_queue_work(uv_default_loop(), req, EncryptAsync, EncryptAsyncAfter);
^
In file included from /home/james/.node-gyp/0.10.24/src/node.h:61:0,
from ../src/bcrypt_node.cc:31:
/home/james/.node-gyp/0.10.24/deps/uv/include/uv.h:1432:15: error: initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
^
../src/bcrypt_node.cc: In function ‘v8::Handle<v8::Value> {anonymous}::Compare(const v8::Arguments&)’:
../src/bcrypt_node.cc:431:74: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
uv_queue_work(uv_default_loop(), req, CompareAsync, CompareAsyncAfter);
^
In file included from /home/james/.node-gyp/0.10.24/src/node.h:61:0,
from ../src/bcrypt_node.cc:31:
/home/james/.node-gyp/0.10.24/deps/uv/include/uv.h:1432:15: error: initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
UV_EXTERN int uv_queue_work(uv_loop_t* loop, uv_work_t* req,
^
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
make: Leaving directory `/home/james/Projects/Greatvines/cube/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
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! cwd /home/james/Projects/Greatvines/cube/node_modules/bcrypt
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! bcrypt@0.7.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.3 install script.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/james/Projects/Greatvines/cube
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/james/Projects/Greatvines/cube/npm-debug.log
npm ERR! not ok code 0
Just wanted to leave specific instructions here for myself and any other lost souls that aren't sure how to fix this.
The credit for this fix goes to @springmeyer. The server I've tested this on is Centos 6.5 x64.
Find the locally installed gyp
python module that is causing problems
$ python -c 'import gyp; print gyp.__file__'
/usr/lib/python2.6/site-packages/gyp/__init__.pyc
Move or rename the folder so that python can't find it
2) $ mv /usr/lib/python2.6/site-packages/gyp /usr/lib/python2.6/site-packages/gyp_backup
Ensure that python can't find it
3) $ python -c 'import gyp; print gyp.__file__'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named gyp
Good! Now try reinstalling!
4) $ npm install
npm http GET https://registry.npmjs.org/hiredis/-/hiredis-0.1.16.tgz
npm http GET https://registry.npmjs.org/redis/-/redis-0.10.0.tgz
npm http 200 https://registry.npmjs.org/hiredis/-/hiredis-0.1.16.tgz
npm http 200 https://registry.npmjs.org/redis/-/redis-0.10.0.tgz
npm http GET https://registry.npmjs.org/bindings/-/bindings-1.1.1.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-1.1.1.tgz
> hiredis@0.1.16 install /srv/www/prex.io/node_modules/hiredis
> node-gyp rebuild
make: Entering directory `/srv/www/prex.io/node_modules/hiredis/build'
CC(target) Release/obj.target/hiredis/deps/hiredis/hiredis.o
CC(target) Release/obj.target/hiredis/deps/hiredis/net.o
CC(target) Release/obj.target/hiredis/deps/hiredis/sds.o
CC(target) Release/obj.target/hiredis/deps/hiredis/async.o
AR(target) Release/obj.target/deps/hiredis.a
COPY Release/hiredis.a
CXX(target) Release/obj.target/hiredis/src/hiredis.o
CXX(target) Release/obj.target/hiredis/src/reader.o
SOLINK_MODULE(target) Release/obj.target/hiredis.node
SOLINK_MODULE(target) Release/obj.target/hiredis.node: Finished
COPY Release/hiredis.node
make: Leaving directory `/srv/www/prex.io/node_modules/hiredis/build'
hiredis@0.1.16 node_modules/hiredis
��� bindings@1.1.1
@qraynaud Awesome, that's good news! It would probably be helpful for future wanderers if you posted the architecture/Python version you are running just to confirm that the fix works on that configuration.
@rex ubuntu 13.10 x64, trying npm install node-expat
. Your solution gave me a hint to just remove the gyp: sudo apt-get remove gyp
and this helped, thanks.
@sheershoff I'm glad it helped! And I wish it was my solution, but I just elaborated on @springmeyer's excellent solution.
Many thanks! It works also on Ubuntu 12.04 LTS, amd64 and Python 2.7.3 trying 'mongodb'
@rex Thanks, your solution help me 👍
Korora 20, python 2.7. Removing gyp's folder from python helps.
Can we get this documented on the front page? Is there an associated issue on the gyp project to correct the underlying problem (https://code.google.com/p/gyp/issues/list)?
Using Ubuntu 13.10 amd64, and I have Python 2.7 installed.
sudo apt-get remove gyp
was enough to fix the issue for me. It wasn't being used by any other packages, so it was a non-issue for me to remove it.
On CentOS 6.5, I finally got it to work by installing this version of Python: http://tutorials.hostucan.net/install-python-2-6-on-centos-5/
Im not able to resolve this issue in my configuration. Im using:
*Centos 6.5
*Python 2.6.6
*Node 0.11.12-stable
When trying npm install, im getting:
gyp: /usr/local/bin/node/common.gypi not found (cwd: /opt/TeamCity/buildAgent/work/baca9f81a302b736/node_modules/tbx-commons-nodejs/node_modules/monk/node_modules/mongoskin/node_modules/mongodb/node_modules/bson) while reading includes of binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:107:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
gyp ERR! System Linux 2.6.32-358.23.2.el6.x86_64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /opt/TeamCity/buildAgent/work/baca9f81a302b736/node_modules/tbx-commons-nodejs/node_modules/monk/node_modules/mongoskin/node_modules/mongodb/node_modules/bson
gyp ERR! node -v v0.11.12
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
Already tried removing gyp python as suggested by @rex, but no luck. Any ideas?
Thanks!
sudo apt-get remove gyp
also worked for me on Linux Mint 16 AMD64 with Python 2.7.5+. Thanks to all of you :)
sudo apt-get remove gyp
also worked for me on Linux 13.04 Python2.7. Thanks!
Renaming the python gyp module worked for me on my local machine. I am trying to deploy an app on Heroku, and running into the same problem. Unfortunately, I can't reach into Heroku's python modules, as far as I know. Has anyone ran into this, or have any suggestions?
Note that this should be fixed permanently (i.e. node-gyp will prefer its internal copy of gyp over a global one from a package manager) in node-gyp v0.13.1 due to 52e8d9f.
For future wonders, I was able to get atom to build on Fedora 20 by using what rex posted here. #363 (comment)
python 2.7
node -v 0.10.26
npm -v 1.4.4
I was running into problems building and installing spell-check0.35.0
this worked for me on Ubuntu 13.10 ...
as suggested by @sheershoff sudo apt-get remove gyp
on Fedora 20:
yum remove gyp
did the job - thank you
Just had the same issue on an Amazon Elastic Beanstalk Instance (64bit Amazon Linux 2014.03 v1.1.0 running Node.js). Had installed globally via sudo yum install nodejs npm --enablerepo=epel
as I needed bunyan to view logs. This borked up my deployments with the same error (AttributeError: 'module' object has no attribute 'script_main'
).
Solved by running sudo yum remove gyp.noarch
. Thanks guys!
Beforehands, I tried to remove node via sudo yum remove nodejs npm --enablerepo=epel
but this did not remove the gyp installation which affected the build.
Same problem on Amazon EC2, fixed w/ sudo npm -g install node-gyp
This worked on Mint 17, also. Thanks!!! I tried upgrading npm, node, switching py versions. It just shuffled the problem around. I thought I was going nuts. This fixed it:
sudo apt-get remove gyp
while running codebox I got an following error Module did not self-register the i used the code node-gyp rebuild. Now its showing this error.
gyp: binding.gyp not found (cwd: /home/logesh/code/megam/workspace/codebox) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.19.0-15-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/logesh/code/megam/workspace/codebox
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
logesh@logesh-Aspire-E1-431:/code/megam/workspace/codebox$ node -v/code/megam/workspace/codebox$ npm -v
v0.12.4
logesh@logesh-Aspire-E1-431:
1.4.21