You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'module' object has no attribute 'script_main' #363
> 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:
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
@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.
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
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.
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
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
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.
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:
Activity
TooTallNate commentedon Dec 7, 2013
Hmmm, I haven't seen this. Seems like a borked gyp install somehow. Perhaps try re-installing?
rex commentedon Dec 8, 2013
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:
Any ideas? :-/
tj commentedon Dec 8, 2013
probably just a funky package manager install, I'll try from source or sth tomorrow
TooTallNate commentedon Dec 8, 2013
@visionmedia Is this using the debian nodejs package or something?
rex commentedon Dec 9, 2013
@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 thenpmversion ofnode-gypwere fruitless, as I believe that theyum-installednode-gypis 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 shrinkwrapet 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:Subsequent attempts to
npm -g updatewere 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 cleandidn't help. Even rannpm -g install inheritsand 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.dready92 commentedon Dec 9, 2013
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.
Please help !
tj commentedon Dec 9, 2013
yeah the package manager ones seem pretty borked
tj commentedon Dec 9, 2013
yup re-install worked for me, so I guess just don't ever use the package managers haha
laithshadeed commentedon Dec 14, 2013
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.
Lujaw commentedon Dec 25, 2013
@laithshadeed Thanks, it solved the issue for me..
scottkellie commentedon Jan 3, 2014
@laithshadeed Also repaired my build on Linux mint 16 :) Thanks was driving me crazy!
springmeyer commentedon Jan 14, 2014
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.matzoe commentedon Jan 15, 2014
@springmeyer same to me. I just removed gyp to solve this problem.
walidsynclio commentedon Jan 17, 2014
I have installed node using sudo apt-get install nodejs
suso apt-get install libexpat1-dev
sudo npm install node-expat
Same Issue
20 remaining items
juancancela commentedon May 4, 2014
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:
gypfailed with exit code: 1gyp 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!
tad-lispy commentedon May 8, 2014
sudo apt-get remove gypalso worked for me on Linux Mint 16 AMD64 with Python 2.7.5+. Thanks to all of you :)compact commentedon May 9, 2014
Similar to @lzrski's comment, in Fedora 20,
yum remove gypis a solution.gawen commentedon May 19, 2014
sudo apt-get remove gypalso worked for me on Linux 13.04 Python2.7. Thanks!JonathanPorta commentedon May 19, 2014
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?
TooTallNate commentedon May 19, 2014
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.
carbohydrate commentedon May 31, 2014
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
gdclarke commentedon Jun 5, 2014
this worked for me on Ubuntu 13.10 ...
as suggested by @sheershoff
sudo apt-get remove gyphapees commentedon Jun 10, 2014
on Fedora 20:
yum remove gyp
did the job - thank you
d0b1010r commentedon Apr 16, 2015
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=epelas 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=epelbut this did not remove the gyp installation which affected the build.Jbudone commentedon May 2, 2015
Same problem on Amazon EC2, fixed w/
sudo npm -g install node-gypdarkoverlordofdata commentedon May 4, 2015
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
LogeshEswar commentedon Sep 8, 2015
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:
gypfailed with exit code: 1gyp 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 -vv0.12.4
logesh@logesh-Aspire-E1-431:
1.4.21
Merge pull request nodejs#363 from microsoft/protect_resize