uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
497 stars 53 forks source link

404 status code downloading SHASUMS.txt #2

Closed bid closed 8 years ago

bid commented 9 years ago

gyp ERR! stack Error: 404 status code downloading SHASUMS.txt gyp ERR! stack at Request. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:316:18)

uhop commented 9 years ago

How to repro? It works for me.

bid commented 9 years ago

Weird. I tried all kinds of things to make this work. I thought it was a problem with node-gyp, but installing that globally and locally didn't change anything. Could it be a problem with the node or npm versions (I recently upgraded my system and node)? Every try to install re2 gave me the same error:

$ npm install re2 npm WARN package.json AI@0.0.0 No repository field. npm WARN package.json AI@0.0.0 No README data \

re2@1.3.1 install /home/bid/Projects/AI/node_modules/re2 node-gyp rebuild

gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: 404 status code downloading SHASUMS.txt gyp ERR! stack at Request. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:316:18) gyp ERR! stack at emitOne (events.js:82:20) gyp ERR! stack at Request.emit (events.js:169:7) gyp ERR! stack at Request.onResponse (/usr/local/lib/node_modules/npm/node_modules/request/request.js:832:10) gyp ERR! stack at ClientRequest.g (events.js:260:16) gyp ERR! stack at emitOne (events.js:77:13) gyp ERR! stack at ClientRequest.emit (events.js:169:7) gyp ERR! stack at HTTPParser.parserOnIncomingClient (_http_client.js:415:21) gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23) gyp ERR! stack at Socket.socketOnData (_http_client.js:305:20) gyp ERR! System Linux 4.2.0-17-generic gyp ERR! command "/usr/bin/nodejs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/bid/Projects/AI/node_modules/re2 gyp ERR! node -v v4.2.2 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok npm ERR! re2@1.3.1 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the re2@1.3.1 install script. npm ERR! This is most likely a problem with the re2 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 re2 npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.2.0-17-generic npm ERR! command "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "re2" npm ERR! cwd /home/bid/Projects/AI npm ERR! node -v v4.2.2 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/bid/Projects/AI/npm-debug.log npm ERR! not ok code 0

(P.S. Sorry for the minimal error message in my first post. I did fall asleep, before finishing my tests... ;) )

uhop commented 8 years ago

I develop on Linux, but just as an example I ran it on Mac:

$ npm install re2 --save
-
> re2@1.3.1 install /Users/elazutkin/Work/temp/node_modules/re2
> node-gyp rebuild

  CXX(target) Release/obj.target/re2/lib/addon.o
  CXX(target) Release/obj.target/re2/lib/new.o
  CXX(target) Release/obj.target/re2/lib/exec.o
  CXX(target) Release/obj.target/re2/lib/test.o
  CXX(target) Release/obj.target/re2/lib/match.o
  CXX(target) Release/obj.target/re2/lib/replace.o
  CXX(target) Release/obj.target/re2/lib/search.o
  CXX(target) Release/obj.target/re2/lib/split.o
  CXX(target) Release/obj.target/re2/lib/toString.o
  CXX(target) Release/obj.target/re2/lib/accessors.o
  CXX(target) Release/obj.target/re2/lib/util.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/bitstate.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/compile.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/dfa.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/filtered_re2.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/mimics_pcre.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/nfa.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/onepass.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/parse.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/perl_groups.o
../vendor/re2/re2/perl_groups.cc:22:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\d", +1, code1, 1 },
                              ^
../vendor/re2/re2/perl_groups.cc:23:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\D", -1, code1, 1 },
                              ^
../vendor/re2/re2/perl_groups.cc:24:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\s", +1, code2, 2 },
                              ^
../vendor/re2/re2/perl_groups.cc:25:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\S", -1, code2, 2 },
                              ^
../vendor/re2/re2/perl_groups.cc:26:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\w", +1, code3, 4 },
                              ^
../vendor/re2/re2/perl_groups.cc:27:24: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "\\W", -1, code3, 4 },
                              ^
../vendor/re2/re2/perl_groups.cc:87:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:alnum:]", +1, code4, 3 },
                                    ^
../vendor/re2/re2/perl_groups.cc:88:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^alnum:]", -1, code4, 3 },
                                     ^
../vendor/re2/re2/perl_groups.cc:89:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:alpha:]", +1, code5, 2 },
                                    ^
../vendor/re2/re2/perl_groups.cc:90:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^alpha:]", -1, code5, 2 },
                                     ^
../vendor/re2/re2/perl_groups.cc:91:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:ascii:]", +1, code6, 1 },
                                    ^
../vendor/re2/re2/perl_groups.cc:92:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^ascii:]", -1, code6, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:93:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:blank:]", +1, code7, 2 },
                                    ^
../vendor/re2/re2/perl_groups.cc:94:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^blank:]", -1, code7, 2 },
                                     ^
../vendor/re2/re2/perl_groups.cc:95:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:cntrl:]", +1, code8, 2 },
                                    ^
../vendor/re2/re2/perl_groups.cc:96:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^cntrl:]", -1, code8, 2 },
                                     ^
../vendor/re2/re2/perl_groups.cc:97:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:digit:]", +1, code9, 1 },
                                    ^
../vendor/re2/re2/perl_groups.cc:98:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^digit:]", -1, code9, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:99:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:graph:]", +1, code10, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:100:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^graph:]", -1, code10, 1 },
                                      ^
../vendor/re2/re2/perl_groups.cc:101:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:lower:]", +1, code11, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:102:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^lower:]", -1, code11, 1 },
                                      ^
../vendor/re2/re2/perl_groups.cc:103:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:print:]", +1, code12, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:104:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^print:]", -1, code12, 1 },
                                      ^
../vendor/re2/re2/perl_groups.cc:105:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:punct:]", +1, code13, 4 },
                                     ^
../vendor/re2/re2/perl_groups.cc:106:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^punct:]", -1, code13, 4 },
                                      ^
../vendor/re2/re2/perl_groups.cc:107:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:space:]", +1, code14, 2 },
                                     ^
../vendor/re2/re2/perl_groups.cc:108:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^space:]", -1, code14, 2 },
                                      ^
../vendor/re2/re2/perl_groups.cc:109:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:upper:]", +1, code15, 1 },
                                     ^
../vendor/re2/re2/perl_groups.cc:110:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^upper:]", -1, code15, 1 },
                                      ^
../vendor/re2/re2/perl_groups.cc:111:30: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:word:]", +1, code16, 4 },
                                    ^
../vendor/re2/re2/perl_groups.cc:112:31: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^word:]", -1, code16, 4 },
                                     ^
../vendor/re2/re2/perl_groups.cc:113:32: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:xdigit:]", +1, code17, 3 },
                                      ^
../vendor/re2/re2/perl_groups.cc:114:33: warning: missing field 'r32' initializer [-Wmissing-field-initializers]
        { "[:^xdigit:]", -1, code17, 3 },
                                       ^
34 warnings generated.
  CXX(target) Release/obj.target/re2/vendor/re2/re2/prefilter.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/prefilter_tree.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/prog.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/re2.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/regexp.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/set.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/simplify.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/tostring.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/unicode_casefold.o
  CXX(target) Release/obj.target/re2/vendor/re2/re2/unicode_groups.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/arena.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/hash.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/rune.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/stringpiece.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/stringprintf.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/strutil.o
  CXX(target) Release/obj.target/re2/vendor/re2/util/valgrind.o
  SOLINK_MODULE(target) Release/re2.node
re2@1.3.1 node_modules/re2
└── nan@2.1.0

It works. Most probably gyp on your box is screwed up somehow — you can see that all complaints are gyp related, and even SHASUMS.txt referred in the title is not shipped with re2.

You may want to try it in a clean VM, or use nvm for a fresh install of node.js (all tools come with it) to see if this is the case.

uhop commented 8 years ago

BTW, this [roject is set up with Travis-CI so you can always see how it runs on Linux with different environments, and what commands are used for that. The latest run is accessible from a button at the top of readme: https://travis-ci.org/uhop/node-re2. You can look at outputs in three different environments and compare it with what you have.

uhop commented 8 years ago

I am closing this issue for now. Feel free to open it, if you still have the problem, and found a way to reproduce it.

bid commented 8 years ago

After some late-night bug-hunting, I found the problem. Just in case someone else stumbles over this and Google sends you here:

I did a node/npm update via the official package on https://github.com/nodesource/distributions But somehow, a simlink was left in /usr/local/bin, pointing to an older version of npm. So the npm version in the package was different from the one in use. I didn't find this at first, because "aptitude show npm" showed the correct (new) version number - but "npm -v" showed the old one.

Purging the old npm-package, manually deleting the simlink and reinstalling the "nodejs" package finally fixed this.

Thanks, uhop. Issue can stay closed now. :)

uhop commented 8 years ago

I actually had a problem similar to yours, but it manifested itself differently. I solved the problem by using nvm, and installing all node versions with it exclusively (they come bundled with npm and gyp). This way I have a uniform experience on all platforms, and do not depend on whatever version of node and tools were bundled with an OS.