简体   繁体   中英

Bower, Grunt on Ubuntu 12.04 - command not found

I've installed bower and grunt on my machine but non of it works. I get :command not found for both.

I've placed paths to bower and grunt in .bash_profile file, like:
export PATH="/home/user/.node/lib/node_modules/grunt-cli/bin:$PATH"
export PATH="/home/user/.node/lib/node_modules/bower/bin:$PATH"

It feels like packages are installed correctly but it can't be found.

Npm and node is located in home/user/.node and home/user/.npm directories is this is the right place for it?

which bower/grunt outputs nothing

Just had to remind myself of this one, to set up environment on a new machine.

As per http://gruntjs.com/getting-started , there are two steps required for installation and use of Grunt.js task runner on a given project:

  1. You should globally install only 'grunt-cli', the Grunt Command Line Interface. This will put the grunt command on your system path. This is achieved by running npm install -g grunt-cli , which may require root privileges depending on your setup.

  2. You should locally install the grunt task runner proper. This is achieved by running npm install , after adding the desired version of Grunt.js to your project's package.json file. This will install the specific version of Grunt.js described in your project's package.json, under the devDependencies section. This is the file used by nodejs to describe project development and deployment dependencies, among other stuff.

I managed to fix it by adding paths to .bashrc file, like:

PATH=$PATH:/home/user/.node/lib/node_modules/grunt-cli/bin
PATH=$PATH:/home/user/.node/lib/node_modules/bower

Reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM