Node-gyp: Change NVM_NODEJS_ORG_MIRROR to NODEJS_ORG_MIRROR to solve npm install error

Created on 25 May 2016  路  13Comments  路  Source: nodejs/node-gyp

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR

Most helpful comment

I see - thanks for the clarification. I don't use node-gyp directly, but node-gyp rebuild is run automatically when node.bcrypt.js is installed, which is when this warning is generated.

It transpires that nvm sets the NVM_NODEJS_ORG_MIRROR variable in the latest version of nvm.sh and, indeed, NODEJS_ORG_MIRROR is not set.

So, it seems like bcrypt isn't going to install correctly when NVM_NODEJS_ORG_MIRROR is removed, and end-users will have to explicitly configure NODEJS_ORG_MIRROR. It seems like a potentially unnecessary configuration step for a lot of people.

If this is the case, is there anything that can be done to make it easier for those people? Do you think 'nvm' should set up the new variable in its script, or is there something bcrypt can do?

All 13 comments

What exactly are you reporting? Does something not work?

npm reports that NVM_NODEJS_ORG_MIRROR is deprecated. Occurrences of this variable need to be changed to NODEJS_ORG_MIRROR

You've got it the wrong way around, it's node-gyp that prints the warning. You have NVM_NODEJS_ORG_MIRROR set in your environment and that will stop working in the next major release.

Closing, not a bug.

I see - thanks for the clarification. I don't use node-gyp directly, but node-gyp rebuild is run automatically when node.bcrypt.js is installed, which is when this warning is generated.

It transpires that nvm sets the NVM_NODEJS_ORG_MIRROR variable in the latest version of nvm.sh and, indeed, NODEJS_ORG_MIRROR is not set.

So, it seems like bcrypt isn't going to install correctly when NVM_NODEJS_ORG_MIRROR is removed, and end-users will have to explicitly configure NODEJS_ORG_MIRROR. It seems like a potentially unnecessary configuration step for a lot of people.

If this is the case, is there anything that can be done to make it easier for those people? Do you think 'nvm' should set up the new variable in its script, or is there something bcrypt can do?

Do you think 'nvm' should set up the new variable in its script

It should, and - in newer releases - it will. We discussed it with the maintainer of nvm before putting in that change.

OK, that's good to hear. nvm doesn't set up the variable yet, but hopefully it will come shortly.
Thanks for explaining all this.

I'm still seeing this under node 7.2.1. Which configuration files are likely to be out of date on my setup?

same here @w@

In my case, I solved this when reverting to 6.9.1 LTS. I haven't tried upgrading to v7 again.

If you don't need to override the mirror, you can add this to your ~/.bash_profile or ~/.bashrc after you source nvm.sh to remove the warning:

unset NVM_NODEJS_ORG_MIRROR NVM_IOJS_ORG_MIRROR

I just opened https://github.com/creationix/nvm/issues/1429 to fix this in nvm proper.

@bnoordhuis I think you may have misunderstood https://github.com/nodejs/node-gyp/issues/787#issuecomment-152363993 - nvm is not planning on adding support for $NODEJS_ORG_MIRROR any time soon (although I don't object to doing so in the future; it's just not worth the extra complexity at this time).

Upgrading to the last NVM version solved the issue for me. 0.33.2

Hi Geeks,
I am facing the below error, could you please advice how can I fix it.

[root@INCARNUS_SERVER nodejs-nan]# node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /root/nodejs-nan/build' CXX(target) Release/obj.target/mimscds/mimscds.o cc1plus: error: unrecognized command line option "-std=gnu++1y" make: *** [Release/obj.target/mimscds/mimscds.o] Error 1 make: Leaving directory/root/nodejs-nan/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/root/n/lib/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 2.6.32-642.13.1.el6.x86_64
gyp ERR! command "/root/n/bin/node" "/root/n/bin/node-gyp" "build"
gyp ERR! cwd /root/nodejs-nan
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lopezdp picture lopezdp  路  3Comments

jhermsmeier picture jhermsmeier  路  3Comments

alexeyvo picture alexeyvo  路  3Comments

adrianescat picture adrianescat  路  3Comments

swaj picture swaj  路  3Comments