After $npm install, Getting Error: Cannot find module '../lib/utils/unsupported.js'

后端 未结 12 2108
星月不相逢
星月不相逢 2021-02-03 21:52

I just came back to work on a React project after working in the Rails environment and found that I cannot run any NPM commands in my Mac terminal. I\'ve tried all the remedies

相关标签:
12条回答
  • 2021-02-03 22:28

    Assume this happens on MacOS, below solution works for me.

    1. brew uninstall --force node
    2. Visit https://nodejs.org/en/ and download the LTS version and install, the error was gone
    0 讨论(0)
  • 2021-02-03 22:28

    I had an issue after upgrade my mac. I tried different solutions available on stack overflow and nothing work for me.

    This solution works for me.

    1. Uninstall node all version brew uninstall --force node
    2. Install it again by this brew install node

    First point remove all node versions if available.

    Done. Enjoy coding.

    0 讨论(0)
  • 2021-02-03 22:28

    Try this one: https://gist.github.com/DanHerbert/9520689

    "If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together."

    Kudos to Dan Herbert for the solution.

    0 讨论(0)
  • 2021-02-03 22:28

    In my case, the solution to the problem was reinstalling the node using the official installer from https://nodejs.org (Mac OS).

    Solution:

    1. Download node installer from https://nodejs.org
    2. Install it

    P.S. The problem appeared after yarn installation.

    0 讨论(0)
  • 2021-02-03 22:34

    Remove all file from following folder

    A)C:\Users\\AppData\Roaming\npm

    B)C:\Users\\AppData\Roaming\npm-cache

    and install node again

    then execute command "npm install -g @angular/cli"

    0 讨论(0)
  • 2021-02-03 22:34

    One other suggestion after trying these that finally worked for me was simply upgrading my node by downloading the latest via the download and package installer from here:

    https://nodejs.org/en/download/

    Before doing this trying to run any npm command gave me the same error brought in OP's question

    npm commands started working for me after that.

    0 讨论(0)
提交回复
热议问题