Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Compilation fails in Node v5.0.0-rc.1 #1224

Closed
mgol opened this issue Oct 28, 2015 · 30 comments
Closed

Compilation fails in Node v5.0.0-rc.1 #1224

mgol opened this issue Oct 28, 2015 · 30 comments

Comments

@mgol
Copy link
Contributor

mgol commented Oct 28, 2015

It might be a node-gyp issue, although the latest 3.0.3 release should be able to download headers for non-stable packages as long as they expose proper process.release object. But in Node v5.0.0-rc.1 I get the output at the bottom of this report. Note the incorrect https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz URL instead of the one in process.release.headersUrl.

I reported it upstream in nodejs/node-gyp#787 in case it's their issue.

The output:

$ node --version
v5.0.0-rc.1
$ npm --version
3.3.10
$ node -p process.release
{ name: 'node',
  sourceUrl: 'https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1.tar.gz',
  headersUrl: 'https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz' }
$ npm i node-sass

> node-sass@3.4.1 install /Users/mgol/_/node_modules/node-sass
> node scripts/install.js

Cannot download "https://github.com/sass/node-sass/releases/download/v3.4.1/darwin-x64-47_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> spawn-sync@1.0.13 postinstall /Users/mgol/_/node_modules/spawn-sync
> node postinstall


> node-sass@3.4.1 postinstall /Users/mgol/_/node_modules/node-sass
> node scripts/build.js

Building: /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node /Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node',
gyp verb cli   '/Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.3
gyp info using node@5.0.0-rc.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (/Users/mgol/_/node_modules/which/which.js:78:19)
gyp verb `which` failed     at E (/Users/mgol/_/node_modules/which/which.js:82:29)
gyp verb `which` failed     at /Users/mgol/_/node_modules/which/which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.0.0-rc.1
gyp verb command install [ '5.0.0-rc.1' ]
gyp verb install input version string "5.0.0-rc.1"
gyp verb install installing version: 5.0.0-rc.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 5.0.0-rc.1
gyp verb ensuring nodedir is created /Users/mgol/.node-gyp/5.0.0-rc.1
gyp verb created nodedir /Users/mgol/.node-gyp/5.0.0-rc.1
gyp http GET https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http 404 https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '5.0.0-rc.1' ]
gyp verb remove using node-gyp dir: /Users/mgol/.node-gyp
gyp verb remove removing target version: 5.0.0-rc.1
gyp verb remove removing development files for version: 5.0.0-rc.1
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/Users/mgol/_/node_modules/node-gyp/lib/install.js:244:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (/Users/mgol/_/node_modules/request/request.js:998:10)
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:418:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:308:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node" "/Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/mgol/_/node_modules/node-sass
gyp ERR! node -v v5.0.0-rc.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
Build failed
npm WARN ENOENT ENOENT: no such file or directory, open '/Users/mgol/_/package.json'
npm WARN EPACKAGEJSON _ No description
npm WARN EPACKAGEJSON _ No repository field.
npm WARN EPACKAGEJSON _ No README data
npm WARN EPACKAGEJSON _ No license field.
npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node" "/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/npm" "i" "node-sass"
npm ERR! node v5.0.0-rc.1
npm ERR! npm  v3.3.10
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.4.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.4.1 postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mgol/_/npm-debug.log
@rvagg
Copy link
Contributor

rvagg commented Oct 28, 2015

I'm suspecting something node-sass specific, I notice node-gyp is in the dependencies list, what's the reason for this? ideally now you should be relying on what ships with the latest npm (v2 and v3) because it has a version of node-gyp that should work properly. Mind you, it has "^3.0.1" in the dependencies list so it should work, although I think it wasn't until 3.0.3 that we got most of the bugs sorted out with header downloads.

$ rm -rf ~/.node-gyp/5.0.0-rc.1/
$ npm i bufferutil
npm http request GET https://registry.npmjs.org/bufferutil
npm http 304 https://registry.npmjs.org/bufferutil
npm http request GET https://registry.npmjs.org/bindings
npm http request GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan

> bufferutil@1.2.1 install /Users/rvagg/node_modules/bufferutil
> node-gyp rebuild

gyp http GET https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http GET https://nodejs.org/download/rc/v5.0.0-rc.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/rc/v5.0.0-rc.1/SHASUMS256.txt
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
...

note the correct url

$ /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js -v
v3.0.3
$ npm -v
3.3.6

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

I'm suspecting something node-sass specific, I notice node-gyp is in the dependencies list, what's the reason for this? ideally now you should be relying on what ships with the latest npm (v2 and v3) because it has a version of node-gyp that should work properly.

I suspect it's to work with npm 1.4.x that's included in Node 0.10. Also, node-sass is still tested in io.js 1.0, 1, 2 & 3 where the included node-gyp is not that up to date.

@saper
Copy link
Member

saper commented Oct 28, 2015

What happens if you take nvm out of equation?

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

@saper nvm doesn't officially support rcs yet (see nvm-sh/nvm#779), I just downloaded the tarball and put it in a correct place and it works. This should be equivalent to just unpacking the tarball and setting the PATH to point to the unpacked Node, that's effectively what nvm does after all. I'd be surprised if nvm was able to interfere here.

That said, I've installed the 5.0.0-rc.1 via the official pkg installer file as well and used nvm system; nvm unload which removes PATH modifications and unloads all nvm functions from the shell and the problem is still there, nothing changed except paths:


> node-sass@3.4.1 install /Users/mgol/_/node_modules/node-sass
> node scripts/install.js

Cannot download "https://github.com/sass/node-sass/releases/download/v3.4.1/darwin-x64-47_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> spawn-sync@1.0.13 postinstall /Users/mgol/_/node_modules/spawn-sync
> node postinstall


> node-sass@3.4.1 postinstall /Users/mgol/_/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli   '/Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.3
gyp info using node@5.0.0-rc.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (/Users/mgol/_/node_modules/which/which.js:78:19)
gyp verb `which` failed     at E (/Users/mgol/_/node_modules/which/which.js:82:29)
gyp verb `which` failed     at /Users/mgol/_/node_modules/which/which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.0.0-rc.1
gyp verb command install [ '5.0.0-rc.1' ]
gyp verb install input version string "5.0.0-rc.1"
gyp verb install installing version: 5.0.0-rc.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 5.0.0-rc.1
gyp verb ensuring nodedir is created /Users/mgol/.node-gyp/5.0.0-rc.1
gyp verb created nodedir /Users/mgol/.node-gyp/5.0.0-rc.1
gyp http GET https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http 404 https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '5.0.0-rc.1' ]
gyp verb remove using node-gyp dir: /Users/mgol/.node-gyp
gyp verb remove removing target version: 5.0.0-rc.1
gyp verb remove removing development files for version: 5.0.0-rc.1
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/Users/mgol/_/node_modules/node-gyp/lib/install.js:244:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (/Users/mgol/_/node_modules/request/request.js:998:10)
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:418:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:308:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/bin/node" "/Users/mgol/_/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/mgol/_/node_modules/node-sass
gyp ERR! node -v v5.0.0-rc.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
Build failed
npm WARN ENOENT ENOENT: no such file or directory, open '/Users/mgol/_/package.json'
npm WARN EPACKAGEJSON /Users/mgol/_ No description
npm WARN EPACKAGEJSON /Users/mgol/_ No repository field.
npm WARN EPACKAGEJSON /Users/mgol/_ No README data
npm WARN EPACKAGEJSON /Users/mgol/_ No license field.
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "node-sass"
npm ERR! node v5.0.0-rc.1
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.4.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.4.1 postinstall script 'node scripts/build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/mgol/_/npm-debug.log

@saper
Copy link
Member

saper commented Oct 28, 2015

@rvagg what how does your node introduce itself? I have this now on a freshly compiled v5.0.0-rc.1:

> node
> process.version
'v5.0.0'
> process.versions
{ http_parser: '2.5.0',
  node: '5.0.0',
  v8: '4.6.85.28',
  uv: '1.7.5',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  modules: '47',
  openssl: '1.0.2d' }

node-gyp cannot possibly guess it should go for rc1 if it isn't there?

@mgol I have reproduced this bug - but I think there is something with our node engines :) but your node reports v5.0.0-rc.1 correctly, I think!

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

@saper Newer node-gyp uses what's in process.release if it exists and only uses hardcoded paths in other cases. On Node v5.0.0-rc.1 I have this:

$ node -p process.release
{ name: 'node',
  sourceUrl: 'https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1.tar.gz',
  headersUrl: 'https://nodejs.org/download/rc/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz' }

The headersUrl field should be used by node-gyp.

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

@saper BTW, you seem to have an incorrect process.version in your compiled binary; that's what I have using the official ones from https://nodejs.org/download/rc/v5.0.0-rc.1/:

$ node -p process.version
v5.0.0-rc.1
$ node -p process.versions
{ http_parser: '2.5.0',
  node: '5.0.0-rc.1',
  v8: '4.6.85.28',
  uv: '1.7.5',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '47',
  openssl: '1.0.2d' }

@saper
Copy link
Member

saper commented Oct 28, 2015

@saper BTW, you seem to have an incorrect process.version in your compiled binary; that's what I have using the official ones from https://nodejs.org/download/rc/v5.0.0-rc.1/:

$ node -p process.version
v5.0.0-rc.1
$ node -p process.versions
{ http_parser: '2.5.0',
  node: '5.0.0-rc.1',
  v8: '4.6.85.28',
  uv: '1.7.5',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '47',
  openssl: '1.0.2d' }

I realized it is incorrect - I wonder why (had to compile it myself)

process.release
{ name: 'node',
sourceUrl: 'https://nodejs.org/download/release/v5.0.0/node-v5.0.0.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v5.0.0/node-v5.0.0-headers.tar.gz' }

look like GitHub gave me this:

https://codeload.github.com/nodejs/node/tar.gz/v5.0.0-rc.1

which has length 36691549 and md5 of 977aaea4a16a808ee8f0c112e243470c
and this is the same as:

https://github.com/nodejs/node/archive/v5.0.0-rc.1.tar.gz

src/node_version.h looks like:

#define NODE_MAJOR_VERSION 5
#define NODE_MINOR_VERSION 0
#define NODE_PATCH_VERSION 0

#define NODE_VERSION_IS_RELEASE 1

so it thinks it is "node v5.0.0", period.

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

@saper That shouldn't matter too much to debug it here, though - your incorrect headersUrl still has /downloads/release/ and installing node-sass still incorrectly looks under /dist/ so it doesn't rely on process.release. If it started you'd still have an error (due to an incorrect URL) but then it would work for others that don't compile by themselves.

@saper
Copy link
Member

saper commented Oct 28, 2015

My "incorrect" node seems to look in the download/release place:

> env CC=cc CXX=c++ node scripts/build.js -f
Building: /usr/local/bin/node /home/saper/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli   '/home/saper/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.3
gyp info using node@5.0.0 | freebsd | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/local/bin/python2
gyp verb check python version `python2 -c "import platform; print(platform.python_version());"` returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.0.0
gyp verb command install [ '5.0.0' ]
gyp verb install input version string "5.0.0"
gyp verb install installing version: 5.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 5.0.0
gyp verb ensuring nodedir is created /home/saper/.node-gyp/5.0.0
gyp verb created nodedir /home/saper/.node-gyp/5.0.0
gyp http GET https://nodejs.org/download/release/v5.0.0/node-v5.0.0-headers.tar.gz
gyp http 404 https://nodejs.org/download/release/v5.0.0/node-v5.0.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '5.0.0' ]
gyp verb remove using node-gyp dir: /home/saper/.node-gyp
gyp verb remove removing target version: 5.0.0
gyp verb remove removing development files for version: 5.0.0
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/download/release/v5.0.0/node-v5.0.0-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/home/saper/node_modules/node-sass/node_modules/node-gyp/lib/install.js:244:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (/home/saper/node_modules/node-sass/node_modules/request/request.js:998:10)
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:418:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:308:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System FreeBSD 10.1-STABLE
gyp ERR! command "/usr/local/bin/node" "/home/saper/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/saper/node_modules/node-sass
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
Build failed

@saper
Copy link
Member

saper commented Oct 28, 2015

It seems that you are using npm@3, maybe that changes something...

@saper
Copy link
Member

saper commented Oct 28, 2015

What happens if you try node scripts/build.js -f ?

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

Node 5 will come with npm@3 included so I think you can't use it with npm@2.

@saper
Copy link
Member

saper commented Oct 28, 2015 via email

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

@saper I'm not sure what's the official policy (I asked in npm/npm#9902 but with no response so far) but 90% of people will use the default (which will be npm@3) anyway.

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

$ node scripts/build -f
Building: /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node',
gyp verb cli   '/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.1
gyp info using node@5.0.0-rc.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:73:28)
gyp verb `which` failed     at E (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:76:29)
gyp verb `which` failed     at /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:84:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.0.0-rc.1
gyp verb command install [ '5.0.0-rc.1' ]
gyp verb install input version string "5.0.0-rc.1"
gyp verb install installing version: 5.0.0-rc.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 5.0.0-rc.1
gyp verb ensuring nodedir is created /Users/mgol/.node-gyp/5.0.0-rc.1
gyp verb created nodedir /Users/mgol/.node-gyp/5.0.0-rc.1
gyp http GET https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http 404 https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '5.0.0-rc.1' ]
gyp verb remove using node-gyp dir: /Users/mgol/.node-gyp
gyp verb remove removing target version: 5.0.0-rc.1
gyp verb remove removing development files for version: 5.0.0-rc.1
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/lib/install.js:244:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (/Users/mgol/Documents/projects/public/node-sass/node_modules/request/request.js:1008:10)
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:418:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:308:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node" "/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/mgol/Documents/projects/public/node-sass
gyp ERR! node -v v5.0.0-rc.1
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
Build failed

@saper
Copy link
Member

saper commented Oct 28, 2015

What is the version of /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js ?

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

BTW, if I run it from Node 4.2.1 (just remember to remove ~/.node-gyp/4.2.1 before invoking the command to force-download) it still incorrectly looks under /dist/, it just finds it there:

$ node scripts/build -f
Building: /Users/mgol/.nvm/versions/node/v4.2.1/bin/node /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/mgol/.nvm/versions/node/v4.2.1/bin/node',
gyp verb cli   '/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.1
gyp info using node@4.2.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:73:28)
gyp verb `which` failed     at E (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:76:29)
gyp verb `which` failed     at /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/node_modules/which/which.js:84:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 4.2.1
gyp verb command install [ '4.2.1' ]
gyp verb install input version string "4.2.1"
gyp verb install installing version: 4.2.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 4.2.1
gyp verb ensuring nodedir is created /Users/mgol/.node-gyp/4.2.1
gyp verb created nodedir /Users/mgol/.node-gyp
gyp http GET https://nodejs.org/dist/v4.2.1/node-v4.2.1-headers.tar.gz
gyp http 200 https://nodejs.org/dist/v4.2.1/node-v4.2.1-headers.tar.gz
...

@saper
Copy link
Member

saper commented Oct 28, 2015

This is because you have node-gyp v3.0.1 and npm@3 makes you believe you have v3.0.3 :)

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

Hah, you're right:

$ cat /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/package.json | grep version                            
  "version": "3.0.1",

So it seems npm@3 is still broken...

@saper
Copy link
Member

saper commented Oct 28, 2015

Can you do the following:

cd /Users/mgol/Documents/projects/public/node-sass
node -p 'node -p 'require.resolve("node-gyp")'

@saper
Copy link
Member

saper commented Oct 28, 2015

It is not npm@3's fault. You should have "migrated to npm@3 properly" and not have leftover packages hidden under the tree:)

node's require module will still find packages under nested node_modules and this is correct.

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

I've wiped node_modules and ~/.node-gyp and invoked npm install afterwards. It didn't help.

I assume you didn't mean the duplicate node -p.

$ cd /Users/mgol/Documents/projects/public/node-sass
$ node -p 'require.resolve("node-gyp")' 
/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/lib/node-gyp.js
$ cat node_modules/node-gyp/package.json | grep version
  "version": "3.0.3"
$ node scripts/build -f                         
Building: /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node',
gyp verb cli   '/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.0.3
gyp info using node@5.0.0-rc.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at F (/Users/mgol/Documents/projects/public/node-sass/node_modules/which/which.js:78:19)
gyp verb `which` failed     at E (/Users/mgol/Documents/projects/public/node-sass/node_modules/which/which.js:82:29)
gyp verb `which` failed     at /Users/mgol/Documents/projects/public/node-sass/node_modules/which/which.js:93:16
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:82:15)
gyp verb `which` failed  python2 [Error: not found: python2]
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 5.0.0-rc.1
gyp verb command install [ '5.0.0-rc.1' ]
gyp verb install input version string "5.0.0-rc.1"
gyp verb install installing version: 5.0.0-rc.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 5.0.0-rc.1
gyp verb ensuring nodedir is created /Users/mgol/.node-gyp/5.0.0-rc.1
gyp verb created nodedir /Users/mgol/.node-gyp/5.0.0-rc.1
gyp http GET https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp http 404 https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '5.0.0-rc.1' ]
gyp verb remove using node-gyp dir: /Users/mgol/.node-gyp
gyp verb remove removing target version: 5.0.0-rc.1
gyp verb remove removing development files for version: 5.0.0-rc.1
gyp ERR! configure error 
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz
gyp ERR! stack     at Request.<anonymous> (/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/lib/install.js:244:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:169:7)
gyp ERR! stack     at Request.onRequestResponse (/Users/mgol/Documents/projects/public/node-sass/node_modules/request/request.js:998:10)
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:418:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:308:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/bin/node" "/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/mgol/Documents/projects/public/node-sass
gyp ERR! node -v v5.0.0-rc.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
Build failed

@saper
Copy link
Member

saper commented Oct 28, 2015

And /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js -v is ...?

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

$ /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js -v
v3.0.3

@mgol
Copy link
Contributor Author

mgol commented Oct 28, 2015

node-sass is not to blame after all, sorry for being mistaken. More: nodejs/node-gyp#787 (comment).

@mgol mgol closed this as completed Oct 28, 2015
@saper
Copy link
Member

saper commented Oct 28, 2015 via email

@saper
Copy link
Member

saper commented Oct 28, 2015

on a serious note, given uptake of npm@3 I think we will need to print the node-gyp version used and its location to the console to increase chance to avoid such issues.

@mgol
Copy link
Contributor Author

mgol commented Oct 30, 2015

node-sass is not to blame after all, sorry for being mistaken. More: nodejs/node-gyp#787 (comment).

I Told You So :)

I wasn't 100% wrong, though - nvm didn't break anything, I just didn't expect node-gyp to change its behavior depending on internal nvm variables...

@slim-souissi
Copy link

how did you fix this please ?

@sass sass locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants