Error: Cannot find module '../lib/utils/unsupported.js' while using Ionic

后端 未结 18 2875
悲哀的现实
悲哀的现实 2020-12-12 09:34

I always get this error message when I run \"Ionic start project name\":

Error message

Running command - failed![ERROR] An error occurred while run         


        
相关标签:
18条回答
  • 2020-12-12 10:10

    On Mac OS X (10.12.6), I resolved this issue by doing the following:

    brew uninstall --force node
    brew install node
    

    I then got an error complaining that node postinstall failed, and to rerun brew postinstall node

    I then got an error:

    permission denied @ rb_sysopen /usr/local/lib/node_modules/npm/bin/npx
    

    I resolved that error by:

    sudo chown -R $(whoami):admin /usr/local/lib/node_modules
    

    And now I don't get this error any more.

    0 讨论(0)
  • 2020-12-12 10:12

    This is a helpful video and blog post about removing node from your computer OS. It is a different method of removal based on how you installed node in the first place (brew vs. binary file downloaded from https://nodejs.org/en/

    • if you installed node with Homebrew then brew uninstall node will work. Verify that with running a node -v command in your terminal.

    • Otherwise and if you have installed the binary file from nodeJS's websitethen you have to run this command in your terminal: sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}. Again, verify that with running a node -v command.

    • In both cases, successful removal of node should result in bash not recognizing what node is if it is completely removed

    0 讨论(0)
  • 2020-12-12 10:13

    Try to remove /usr/local/lib/node_modules/npm and reinstall node again. This should work.

    On MacOS with Homebrew:

    sudo rm -rf /usr/local/lib/node_modules/npm
    brew reinstall node
    
    0 讨论(0)
  • 2020-12-12 10:13

    As mentioned earlier.

     sudo rm -rf /usr/local/lib/node_modules/npm
     brew uninstall --force node                
     brew install node
    
    0 讨论(0)
  • 2020-12-12 10:14

    Yes you should re-install node:

    sudo rm -rf /usr/local/lib/node_modules/npm
     brew uninstall --force node                
     brew install node
    
    0 讨论(0)
  • 2020-12-12 10:15

    I received a similar error and now have it working.

    First make sure you have the latest version

    brew update
    

    Remove your previous instance of node:

    brew uninstall node
    

    Then reinstall the latest version:

    brew install node
    

    And then make sure it is symlinked into /usr/local if it isn't already. You would get an error to let you know to complete this step.

    brew link --overwrite node 
    

    More details on how to install/upgrade node are also available.

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