Troubleshooting Local Frontend Build Errors

Problem

Sometimes switching front-end projects can keep work interesting and fun. Other times, it can lead to high blood pressure and an urge to throw your mouse in the bin. This troubleshooting article is meant to save the lives of all those mice. 

Solution

  1. If you switch from a branch to another (eg. mnoe-admin-panel#1.0 to mnoe-admin-panel#2.0), dependencies versions can be corrupted:

    Re-install project dependencies
    # Delete 'node_modules' and 'bower_components' folders from the project
    rm -rf node_modules/ bower_components/
    
    # Re-install the correct dependencies versions
    npm install && bower install
  2. Check your version of Node.js. Some projects include dependencies/packages that rely on a certain version of Node.js. If your current version is too old, or too new, it can cause errors during your build. If you encounter a Node.js version error, the correct version to use will be displayed. You can then use NVM to install and switch to the correct Node.js version.
    NVM
    # Install node v6
    nvm install 6
    
    # List the versions available
    nvm list
    
    # Switch to node v6
    nvm use 6
  3. If you are receiving errors because of a missing package or missing command, installing it locally in the project may not remedy the error. In this case try installing the package globally via multiple channels (process of elimination). Ex. "yarn add global...", "npm install -g...", "bower install -g..."


Filter by label

There are no items with the selected labels at this time.