Npm Debugging Guidelines (Failed npm install, bower install, or gulp build? Read this)

Sage is tested on Travis CI with every commit to make sure that npm install, bower install, and gulp all work properly. Bugs can still pop up, but usually there’s something wrong with your environment if you can’t get things running.

If you’re running into problems, first make sure that your development environment meets the minimum requirements:

  • Node.js >= 4.5.0
  • gulp >= 3.8.10
  • Bower >= 1.3.12

Ensure you’re using the latest version of npm: npm install -g npm@latest

Then run npm cache clear && rm -rf node_modules && npm install from your theme directory. You might want to run it and make a note of the errors you’re getting, if any.

Let us know what versions of things you’re running by typing node -v && npm -v && gulp -v

10 Likes

Recommendations

Use nvm to manage node versions

nvm installs node in your user’s home directory without needing superuser privileges. It also allows you to toggle between versions of node effortlessly. You can use nvm to install node on your server as well.

:warning::warning::warning: Do not use sudo with npm :warning::warning::warning:

You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

The fix is documented here: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Check the Troubleshooting Wiki

6 Likes

Additional resources (thanks @amadeo):

5 Likes