Issue updating to node version 10.6

I’ve been at this for days and I can’t seem to fix this. It runs well on my local system (that has python 2.7) but does not run well on the server (that has python 2.6). I’m not sure if python version is the issue though. I had an older version of node before and it was working well on the server.
When I try to install couchbase (npm install couchbase), I get this error :

> iconv@2.3.0 install /***/projectname/node_modules/iconv
> node-gyp rebuild

make: Entering directory `/***/projectname/node_modules/iconv/build'
  CXX(target) Release/obj.target/iconv/src/binding.o
cc1plus: error: unrecognized command line option "-std=gnu++1y"
make: *** [Release/obj.target/iconv/src/binding.o] Error 1
make: Leaving directory `/***/projectname/node_modules/iconv/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 2.6.32-573.8.1.el6.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /***/projectname/node_modules/iconv
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN projectname@1.0.0 No description
npm WARN projectname@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iconv@2.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iconv@2.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I’m unable to install node-gyp aswell. Tried various SO solutions but end up with this same problem. When I try to run my node project, I get this :

Error: Could not locate the bindings file. Tried:
 → /***/projectname/node_modules/couchbase/build/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/build/Debug/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/build/Release/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/out/Debug/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/Debug/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/out/Release/couchbase_impl.node
 →/***/projectname/node_modules/couchbase/Release/couchbase_impl.node
 →/***/projectname/node_modules/couchbase/build/default/couchbase_impl.node
 → /***/projectname/node_modules/couchbase/compiled/10.6.0/linux/x64/couchbase_impl.node
    at bindings (/***/projectname/node_modules/bindings/bindings.js:93:9)
    at Object.<anonymous> (/***/projectname/node_modules/couchbase/lib/binding.js:203:36)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/***/projectname/node_modules/couchbase/lib/couchbase.js:3:15)

I don’t have an option to upgrade to 2.7 on the server. Any help would be greatly appreciated.
Thanks

I don’t know anything about Python, but I do know that I sometimes run into installation issues as well, especially when upgrading. Usually one of these two methods fix the problem for me:

  1. Do a clean install on a completely new server. And don’t install anything extra.
    Just the basics to see what works and what doesn’t.

  2. Install an older version of either python / node gyp / anything.
    Hope this helps.

Hi, Thanks for the reply. I had it working with Node version 8.9.4, I just recently did a fresh install of node 10.6 and faced this problem. Will try reinstalling again.

1 Like

Hey @deepashok,

What OS are you using, perhaps CentOS 6? Node.js v10.x requires gcc 4.9+ for C++14 support - see nodejs/node#16501 and nodejs/node-gyp#1420.

Cheers, Brett

2 Likes

Hey brett,

Yeah i’m using RHEL 6.7. Oh So I need RHEL 7 in that case?

Thanks alot for the quick response, I downgraded Node to 8.6 and it started working again. So yeah I guess that’s the issue.

Regards,
Deep