I thought that node-gyp 3.0.3 should have this all fixed by taking the data from process.release but it still downloads from the default one for me:
$ node --version
v4.2.1
$ npm --version
3.3.10
$ node -p process.release
{ name: 'node',
lts: 'Argon',
sourceUrl: 'https://nodejs.org/download/release/v4.2.1/node-v4.2.1.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v4.2.1/node-v4.2.1-headers.tar.gz' }
$ npm i [email protected]
Switch to Node 5 & then (notice the incorrect URL https://nodejs.org/dist/v5.0.0-rc.1/node-v5.0.0-rc.1-headers.tar.gz):
$ 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 rebuild node-sass
> [email protected] 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
> [email protected] 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 [email protected]
gyp info using [email protected] | 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 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" "rebuild" "node-sass"
npm ERR! node v5.0.0-rc.1
npm ERR! npm v3.3.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
Actually, just running npm i node-sass in a fresh directory with Node 5.0.0-rc.1 is giving those errors. No need to rebuild.
I reported it also to node-sass in case it's their fault: https://github.com/sass/node-sass/issues/1224
$ 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
> [email protected] 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
@rvagg @saper So, it seems unrelated to node-sass after all. I can't reproduce your success in installing bufferutils, either on [email protected] or [email protected] so either npm or node-gyp seems to be to blame; not sure why it works for you...
$ npm i bufferutil
> [email protected] install /Users/mgol/_/node_modules/bufferutil
> node-gyp rebuild
gyp WARN install got an error, rolling back install
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/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/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/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/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/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mgol/_/node_modules/bufferutil
gyp ERR! node -v v5.0.0-rc.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
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 "/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" "bufferutil"
npm ERR! node v5.0.0-rc.1
npm ERR! npm v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bufferutil 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 bufferutil
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 @saper So, it seems unrelated to
node-sassafter all. I can't reproduce your success in installingbufferutils, either on [email protected] or [email protected] so eithernpmornode-gypseems to be to blame; not sure why it works for you...$ npm i bufferutil > [email protected] install /Users/mgol/_/node_modules/bufferutil > node-gyp rebuild
What does this say?
find /Users/mgol -name node-gyp
$ find /Users/mgol -name node-gyp
/Users/mgol/.heroku/node-v4.1.1-darwin-x64/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.heroku/node-v4.1.1-darwin-x64/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/.npm/node-gyp
/Users/mgol/.npm/registry.npmjs.org/node-gyp
/Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/node_modules/.bin/node-gyp
/Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/.bin/node-gyp
/Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.0/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/node_modules/.bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/.bin/node-gyp
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/.bin/node-gyp
/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/node-gyp
/Users/mgol/Documents/projects/public/node/deps/npm/bin/node-gyp-bin/node-gyp
/Users/mgol/Documents/projects/public/node/deps/npm/node_modules/node-gyp
/Users/mgol/Documents/projects/public/node-sass/node_modules/.bin/node-gyp
/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp
plus some other unrelated packages under /Users/mgol/Documents/projects/.
On Wed, 28 Oct 2015, Micha艂 Go艂臋biowski wrote:
$ find /Users/mgol -name node-gyp /Users/mgol/.heroku/node-v4.1.1-darwin-x64/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.heroku/node-v4.1.1-darwin-x64/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/.npm/node-gyp /Users/mgol/.npm/registry.npmjs.org/node-gyp /Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/node_modules/.bin/node-gyp /Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/.bin/node-gyp /Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v4.2.0/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/node_modules/.bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/.bin/node-gyp /Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/bin/node-gyp-bin/node-gyp /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/.bin/node-gyp /Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/node-gyp /Users/mgol/Documents/projects/public/node/deps/npm/bin/node-gyp-bin/node-gyp /Users/mgol/Documents/projects/public/node/deps/npm/node_modules/node-gyp /Users/mgol/Documents/projects/public/node-sass/node_modules/.bin/node-gyp /Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp
- some other unrelated packages under
/Users/mgol/Documents/projects/.
and all of them are 3.0.3 ? ... I also wonder why npm@3 in its awesomeness
still installs node-gyp under node-sass/node_modules/node-gyp ? Is there some
other node-gyp version in the way?
I also wonder why npm@3 in its awesomeness
still installs node-gyp under node-sass/node_modules/node-gyp
The global lib/node_modules contains only directly installed packages, trees are flattened only in their own node_modules (see https://github.com/npm/npm/issues/9593#issuecomment-142117641)
$ find /Users/mgol -path \*/bin/node-gyp.js -exec echo {} \; -exec node {} -v \;
/Users/mgol/.heroku/node-v4.1.1-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.1
/Users/mgol/.nvm/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v0.12.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v4.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/david/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v4.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/.nvm/versions/node/v5.0.0-rc.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/Documents/projects/public/node/deps/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/Documents/projects/public/node-sass/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
/Users/mgol/Documents/projects/public/npm/node_modules/node-gyp/bin/node-gyp.js
v3.0.3
@mzgol all of this is because we are using nvm.
Copy from https://github.com/nodejs/node/pull/3466#issuecomment-151939688:
It's because of nvm's env variable NVM_NODEJS_ORG_MIRROR that is equal to https://nodejs.org/dist and is used by node-gyp. Is it really necessary to read this variable ?
@mzgol does it work for you with NVM_NODEJS_ORG_MIRROR="" npm i bufferutil ?
Shoot, I thought I unloaded nvm correctly before replying to https://github.com/sass/node-sass/issues/1224#issuecomment-151832069 but it seems I didn't do it correctly... I've just tried again and it works without nvm.
Is there any reason to read NVM_NODEJS_ORG_MIRROR? It doesn't seem to make sense to read it since it's no longer a single URL prefix for all versions.
@targos Yup, NVM_NODEJS_ORG_MIRROR="" npm i bufferutil works fine.
NVM_NODEJS_ORG_MIRROR is now read by node-gyp to allow mirrors of nodejs.org, mainly people in China. Are you setting NVM_NODEJS_ORG_MIRROR yourself or is nvm doing it? If this is something that nvm does as standard then I'm more concerned, if you're setting it then at least you know what the problem is now.
Also, this is just for the RC, when v5.0.0 goes live it'll be fetchable in /dist/ as expected.
nvm is setting NVM_NODEJS_ORG_MIRROR if it doesn't already exist:
https://github.com/creationix/nvm/blob/master/nvm.sh#L87-L94
argh
@ljharb: this is going to have to change if you want to support release candidates, node-gyp is now using NVM_NODEJS_ORG_MIRROR as well. Alternatively we could remove it from node-gyp but we'll have to come up with an alternative to support people needing mirrors.
It's surprising to me that node-gyp reads NVM_ env variables which should be reserved for nvm. If an env. variable to set up mirror URLs is desired, I'd expect them to be generic and not influenced by NVM. After all, not only nvm users might want to use those mirrors.
I initially thought it's a node-sass issue because I had a feeling nvm couldn't break Node in such a way. My intuition was partially right... I just didn't expect node-gyp to rely on nvm config.
nvm uses NVM_NODEJS_ORG_MIRROR internally as the URL from which Node versions are to be downloaded. Therefore, this variable has to be set by nvm before any Node is activated yet. This logic may be incompatible with future plans to add RC support to nvm, I'd expect more than one env. variable to be used, each for a separate release type (unless all mirrors follow the same pattern of putting RC versions under /rc/) which will make this node-gyp logic incorrect anyway.
This shows to me that node-gyp should use a separate variable, otherwise it implicitly depends on internal nvm logic that might change in the future. It's fragile.
@rvagg um - yes, reading nvm's internal env variables (instead of just using them to modify nvm's behavior) is a very bad idea. I've changed these before as a non-breaking change.
I think what would make more sense is a node-gyp specific env var for mirrors.
I don't see how this impacts RC support, as I won't _at all_ be changing the mirror logic for it.
Maybe node-gyp should use somthing like electron-downloader.
Electron uses this tool for other electorn products (electron-prebuilt and electron-packager)
And it has a shared env variable to set the mirror.
Maybe we should write a node-downloader? for headers and source. So its official in one place.
That way, developers depending on the node dist url could use the package.
I think we're just going to have to remove NVM_NODEJS_ORG_MIRROR and invent our own env var for this.
@noamokman node-gyp _is_ that downloader, there shouldn't be a need for a separate tool, the logic is all in here.
I have always thought this feature is in the node-gyp only to address some (arguable) shortcoming in how the node itself is packaged: I always get my current node include and .gyp files installed in /usr/local/include/node. One could imagine that this could be shipped as a part of the node distribution or as a separate node-dev-alike package.
With this issue solved node-gyp could just be a thin layer over gyp, that works 100% offline.
I am always installing necessary header files in /usr/local/include/node and I always use --nodedir option to skip a whole verify-and-maybe-download step at all. (FreeBSD port takes care of installing the includes for me so it always matches my node version).
+1
Unable to:
npm install node-sass for this reason
+1 on this.
Unable to: npm i node-sass using nvm.
Going through this thread but I'm not understanding the workaround. Could someone explain in moron terms?
I propose we introduce NODEJS_ORG_MIRROR to node-gyp, completely replacing NVM_NODEJS_ORG_MIRROR. It was clearly a mistake to introduce it but it was done in response to a request by Chinese users who were already using that functionality with nvm.
It'll be a breaking change so we'll have to bump semver-major and we'll have to communicate the change to users, the README is probably the best we can do on that front.
I propose we introduce NODEJS_ORG_MIRROR to node-gyp, completely replacing NVM_NODEJS_ORG_MIRROR. It was clearly a mistake to introduce it but it was done in response to a request by Chinese users who were already using that functionality with nvm.
:+1:
Sounds good to me.
Makes sense. I'm sure someone will request that nvm support NODEJS_ORG_MIRROR as well.
@rvagg could you add NODEJS_ORG_MIRROR as a semver-minor change now, supporting both, and then wait for the next semver-major to drop support for NVM_NODEJS_ORG_MIRROR?
yes, good call @ljharb, I need to get the headers download in for 0.12.10 and 0.10.42 in before we bump a major anyway so I'll try and bundle that and hopefully it'll be palatable enough for npm to include in v2
solution @ https://github.com/nodejs/node-gyp/pull/878, reviewers welcome
we've moved a step closer with v3.3.0 just out that introduces NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR and deprecates the NVM_* versions of them and prints a warning on use. We'll remove those completely from v4 (timeline to be decided ..)
In case anyone still come here because npm install node-sass cannot be executed because he/she is behind a corporate proxy or needs to work offline.
The root cause of the problem is the post-script of node-sass cannot download binding.node from github.
Cannot download "https://github.com/sass/node-sass/releases/download/v3.4.1/darwin-x64-47_binding.node":
We need provide the file before it goes to github. Steps:
Most helpful comment
In case anyone still come here because npm install node-sass cannot be executed because he/she is behind a corporate proxy or needs to work offline.
The root cause of the problem is the post-script of node-sass cannot download binding.node from github.
We need provide the file before it goes to github. Steps: