0

I tried to update NPM by using the following command:

sudo npm install -g npm@latest

Not only did it not appear to update NPM but now every time I try to run a command related to Node I get the following error:

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    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 Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

I tried updating again but I get the error. I tried uninstalling but I get the error. I tried installing NVM but I get the error. I can't seem to do anything Node related now without this error.

kmgdev
  • 2,607
  • 28
  • 41

1 Answers1

0

I ended up having to completely uninstall npm and node following these instructions: https://stackoverflow.com/a/11178106/532742

Then I re-installed everything using Homebrew this time: http://blog.teamtreehouse.com/install-node-js-npm-mac

kmgdev
  • 2,607
  • 28
  • 41