1

I have installed and uninstalled node and cant see to get the thing to work right.

When I type node -v I get the version back but if i type npm -v I get this error

module.js:544
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)

While possibly unrelated, I recently started using gulp.js and that's when the issue began to occur.

1 Answer 1

1

Likely you have some permission errors with the npm node_modules package.

Simply delete your node_modules folder, then reinstall node.

Clearing global node modules

rm -rf /usr/local/lib/node_modules/

Reinstalling Node and npm

brew install node

or download and install using the node installer: https://nodejs.org/en/download/

To see if Node is installed, type node -v in Terminal. This should print the version number.

To see if NPM is installed, type npm -v in Terminal. This should print the version number.

Sign up to request clarification or add additional context in comments.

5 Comments

:( Trent now node -v does not work and npm -v . It got worse.
Sorry to hear. I’m mobile right now, but can you try running the first command now to uninstall node modules, then install using the installable package on nodejs.org website?
Note, you may need to restart terminal for packages to be accessible by command line.
for the save! using nodejs.org did it for me by adding the bash command to my local/bin folder since it was missing.
@Justin, I've edited my answer to include this solution. Thanks for the 'accepted answer'!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.