Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails under arch #104

Open
flying-sheep opened this issue Nov 22, 2013 · 5 comments
Open

build fails under arch #104

flying-sheep opened this issue Nov 22, 2013 · 5 comments

Comments

@flying-sheep
Copy link

configure and build works, but it can’t find socket.io.js. which isn’t surprising because it doesn’t get downloaded by npm.

$ cd "$srcdir/package"
$ sed -i 's/"make"/"make gyp"/' package.json
$ npm install -g --prefix "$pkgdir/usr"

> tty.js@0.0.3 preinstall /tmp/nodejs-tty-js/pkg/nodejs-tty-js/usr/lib/node_modules/tty.js
> make gyp

node-gyp configure
node-gyp build
[...]
make[1]: Leaving directory '/tmp/nodejs-tty-js/pkg/nodejs-tty-js/usr/lib/node_modules/tty.js/build'
cp -f node_modules/socket.io-client/dist/socket.io.js static/io.js
cp: der Aufruf von stat für „node_modules/socket.io-client/dist/socket.io.js“ ist nicht möglich: Datei oder Verzeichnis nicht gefunden
Makefile:6: recipe for target 'gyp' failed
make: *** [gyp] Error 1
[...]
@shurane
Copy link

shurane commented Nov 28, 2013

It could be a problem with using python3.x instead of python2.x. node-gyp relies on python to run/compile certain files. If you look at the pages for node-gyp, it says python 3.x.x is not supported.

That being said, a way to get around this would be using virtualenvwrapper or something else that changes which version of python you're using. I'll put in more information later.

@GottZ
Copy link

GottZ commented Sep 10, 2014

recommended close: on arch you can fix it by using this: export PYTHON=python2 or this: node-gyp build --python=python2
thats not so related to this project and belongs to node-gyp

@flying-sheep
Copy link
Author

why isn’t this default behavior?

PEP 394 clearly says

  • When invoked, python2 should run some version of the Python 2 interpreter, and python3 should run some version of the Python 3 interpreter.
  • Similarly, the more general python command should be installed whenever any version of Python is installed and should invoke the same version of Python as either python2 or python3.

therefore --python=python2 is always right if the program needs Python 2, and the default behavior is a bug.

/edit: added a pull request for gyp. but it doesn’t hurt to explicitly fix this here because 1. it’ll take time until this gets pulled, put into some release, and used in all distros, and 2. the error message here doesn’t indicate that this is the cause at all.

@GottZ
Copy link

GottZ commented Sep 12, 2014

Well. Arch is hard to configure. People just forget to add python2 as export because you need deep knowledge of how everything works. It's not there by default because you can customize everything you want. If someone uses zsh and not bash how should the installer know where to put that export?

You are however right about that behavior.. In the past when python 3 didn't exist, /usr/bin/python would point at python 2. Now it points to one of them depending on how you configured it.

Node-gyp could just check if python2 as command exists within the path variable but thats none of tty.js business.

@flying-sheep
Copy link
Author

i meant that we can fix this locally as well, because python2 is always right.

and export PYTHON=python2 globally isn’t right: only gyp uses that variable like this. others could want it to refer to the python3 binary.

the right thing is to call python2 if you want to use Python 2. and even if that is a gyp bug, why not force buggy software we rely on to do the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants