How to update node dependencies in sage 8?

I have an old project that needs some changes. When I run npm install I get an error midway through the process. The process actually continues past the error, but I cant run gulp.

Error during npm install

  SOLINK_MODULE(target) Release/.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/.node] Error 1
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:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 19.2.0
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 /Users/designlobby/Sites/+trellis/
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok 

Error when trying to run gulp:

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/designlobby/Sites/+trellis/
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

So, how would I update SOLINK_MODULE to use libc++, if that is possible?

Thanks in advance for any help!

Use a specific node version. For that reason I always add a .nvmrc to a project.
Sage 8 should work with node 8, install it using nvm or nave as node version managing tool.

Edit: Replaced the ruby related version tools with node ones :blush: .

1 Like

Great, thanks so much!
I didn’t know about .nvmrc, very useful :+1: