I'm using node/grunt for deploying to a shared hosting server.
I have node installed in $HOME/opt/node
I don't know where npm install -g grunt is going to install it to, or how to tell npm to install global files to $HOME/some/path.
I ran npm install grunt -g and it seemed to work, but I cannot find the grunt binary anywhere.
If you want the grunt command in your server's shell, you'll need to install the Grunt CLI.
npm install grunt-cli -g
Global modules are located here:
/usr/local/lib/node_modules
Related
I am new with Node and npm, and when I try to install packages locally, all of the dependencies for that specific package gets installed in the main nodule_modules folder.
It looks like this
LOCALLY
And if I install them globally it looks like this
GLOBALLY
I think I should mention the fact that the folder where I try to install locally is on Desktop.
If you need to install specific dependancies for a project you are working on then do it locally:
npm install <packagename>
If you need something that you can run from the commandline such as grunt or phantomjs (etc..) then install it globally:
npm install -g <packagename>
Reinstalled node/npm from scratch and after npm install I can see the node_modules folder with all of the content from package.json. Checking gulp -v gives command not found in the command line on a mac. If I install gulp globally, gulp -v yields the version.
Is there a way of not installing all dependancies globally to use?
Generally gulp is a package which is used to run some task. These task might need to have administrator privileges. So it is better to install it globally using "npm install -g gulp" command. Here -g means "install it globally".
npm install installs the package locally.
I have never used grunt but I am trying to install project using github.
They ask me to install assets using grunt. I read documentation on grunt website and have installed the grunt using npm install -g grunt-cli. I have also installed node.js.
I already ran npm install -g grunt-cli bower and it runs without problem but "npm install" fails with many errors.
I would be grateful if somebody can guide me how to install the assets using grunt using a dummy "github project."
Thanks
I have installed npm and installed grunt, but when i run grunt, it says 'grunt' is not recognized as an internal or external command.
I done the below steps in command prompt
npm install
npm install -g grunt-cli
PATH variable and grunt folder are available but still i am not able to run grunt.
Please provide me a solution for this
You have only installed the command line interface.
Use npm install -g grunt to install the actual program.
It's really easy to install a Node module from NPM with:
sudo npm install -g ModuleName
But how about doing the same from a Node application code that is on the same machine?
How can it be installed globally? I want to be able to execute it without entering the full path and without publishing it to NPM.
Thanks Chad, that's correct. I can just go inside the application and run sudo npm install -g.