How do I list Node.js version and path currently being used in npm?

Viewed 13696

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?

1 Answers
Related