4

I'm currently running into the same error as this Stackoverflow question had: SyntaxError: Use of const in strict mode?, although I'm getting it while trying to install Flux.

I've already updated my system's Node.js version with the commands shown in the linked Stackoverflow question.

npm cache clean -f
sudo npm install -g n
sudo n stable

When I run node --version I get the correct version, v8.2.1. However, when I install modules via npm, I still get warnings such as

npm WARN engine har-schema@1.0.5: wanted: {"node":">=4"} (current: {"node":"v0.10.25","npm":"1.3.10"})

...which suggests that npm is still using an old version of Node.

Is there a way that I can find the version of Node seen by npm, and can I determine the directory where it is installed to?

E_net4
  • 27,810
  • 13
  • 101
  • 139
Christopher Sheaf
  • 185
  • 1
  • 3
  • 13

1 Answers1

7

I just tried npm info which isn't a thing evidently, because I got all errors. But the first line was my OS version, second was PATH to node.exe and PATH to npm-cli.js, third was node version, fourth was npm version. Then invalid package.json, etc, etc I'm sure there's a right way, but I think it showed me everything you are hoping to see... Forgive me for suggesting bad answer. Maybe just check your npm-debug.log Perhaps you can find answers to your questions there.

** EDIT I found something in npm help

try npm config list

Matthew Hall
  • 131
  • 1
  • 5
  • 1
    `npm config list` gave me the `node bin location`, and also led me to `npm config ls -l` which contained a `node-version` string. As it turns out, npm is using an absolute path to /usr/bin/nodejs. The latest version of node is installed to /usr/local/bin/node with a symlink to /usr/local/bin/nodejs, but npm seems happy to ignore my $PATH variable entirely. Now I just need to find a way to point npm to the proper directory and I'm set. – Christopher Sheaf Jul 29 '17 at 01:33