Login with github
Forum /

Mikhail Davydov wrote a tool called bem-cli that launches locally installed bem-tools.

Sometimes BEM projects have different versions of bem-tools, and you can not simply run npm i -g bem to install bem-tools globally. Also there may be other reasons such as lack of root privileges.

We also recommend you to install bem-tools locally with npm i bem to prevent conflicts with other BEM projects.

Locally installed bem can seem inconvenient to use. You have to run bem from project root, typing the full path to the bin/bem script ./node_modules/.bin/bem make. You may also create a symbolic link ln -s ./node_modules/.bin/bem and run it like this ./bem or add the path of your local ./node_modules/.bin directory to the environment variable PATH. There are many ways to do that, for example, smartcd.

Inspired by Grunt.js project, Mikhail created bem-cli - a tool that finds local or global bem-tools and runs it as if it was installed globally.

Install bem-cli globally with npm i -g bem-cli, and you will have access to the bem command anywhere on your system.

GitHub repository for bem-cli. Issues.

Mikhail Davydov is a JavaScript and Node.js developer. Now he is working on the front end of Yandex.Taxi, mobile web-applications and promo-projects. He also writes and translates articles on JavaScript for the Russian web-community Habrahabr under azproduction.

Twitter, GitHub, and Stay BEMed!