Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»Nodejs»How to Install Grunt on Ubuntu 22.04 & 20.04

    How to Install Grunt on Ubuntu 22.04 & 20.04

    By RahulJuly 19, 20222 Mins Read

    Grunt is a node-based task runner that helps developers automate common tasks during the software development process. It can be used to compile code, run tests, and more. grunt is easy to install and configure, and it can be used with any programming language.

    Advertisement

    Grunt is available as a free, open-source tool, that is typically used in conjunction with other tools, such as Git and npm. A grunt is a powerful tool that can help developers save time and improve their workflow.

    In this blog post, you will learn to install Grunt on Ubuntu systems.

    Prerequsities

    Assuming you already have Node.js and NPM installed on your system. Otherwise, you can visit our other tutorial to install Node.js on Ubuntu systems.

    Verify the Node.js and NPM versions:

    node --version 
    npm  --version 
    

    Installing Grunt CLI

    Once you have verified that Node.js and NPM are on your system. Use the following command to install Grun CLI on your system globally.

    npm install grunt-cli --location=global 
    

    After successfully installation, check the installed version of Grunt-cli:

    grunt --version 
    
    Output
    grunt-cli v1.4.3

    Now, you add the "scripts": { "test": "grunt test" } to the package.json. Now, run “npm test” to initiate the grun test command.

    Enable Shell Auto-completion

    You can also enable the tab auto-completion for Grunt, and add one of the following lines to your ~/.bashrc or ~/.zshrc file based on your active shell.

    • Bash shell users edit ~/.bashrc and apped the following code
      1
      eval "$(grunt --completion=bash)"
    • Zsh shell users edit ~/.zshrc and apped the following code
      1
      eval "$(grunt --completion=zsh)"

    Conclusion

    In this tutorial, you have learned to install Grunt-CLI on your Ubuntu system. Also configured the tab auto-completion.

    grunt grunt-cli node.js npm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Error: EACCES: permission denied, scandir (Resolved)

    Running “npm start” with PM2

    How to Install Bower on Ubuntu 22.04 & 20.04

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.