none
Error running Grunt file

    Question

  • I am getting the following error:

    Fatal error: Unable to find local grunt.
    If you're seeing this message, either a Gruntfile wasn't found or grunt
    hasn't been installed locally to your project. For more information about
    installing and configuring grunt, please see the Getting Started guide:
    http://gruntjs.com/getting-started

    I also ran this from the command line:

    npm install -g grunt-cli

    Still the same. What am I missing?

    Thanks

    Wednesday, March 08, 2017 10:05 AM

All replies

  • Hi markgoldin,

    Please install it via NuGet manager, and please refer to following screenshot (right-click the project->click Manage NuGet Packages):

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by qing__Moderator Friday, March 10, 2017 8:25 AM
    • Marked as answer by markgoldin Monday, March 13, 2017 2:04 PM
    • Unmarked as answer by markgoldin Thursday, March 16, 2017 2:08 PM
    Friday, March 10, 2017 5:13 AM
    Moderator
  • Hi friend,

    If my reply help you resolved your issue, please remember to mark it, which could be helpful for others who have the same issue as yours. if not, please feel free to let me know.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 13, 2017 1:38 PM
    Moderator
  • If I dont have a project what kind of project for testing purposes would I create? Also after creating a project add adding Gruntfile.js to it what do I do next?

    Ok, I have created a project and added gruntfile.js to it. 

    When I run it I get this in Output window:

    Attempting to gather dependency information for package 'Grunt.0.1.13' with respect to project 'CompileCustomCSS', targeting '.NETFramework,Version=v4.5.2'
    Gathering dependency information took 324.62 ms
    Attempting to resolve dependencies for package 'Grunt.0.1.13' with DependencyBehavior 'Lowest'
    Resolving dependency information took 0 ms
    Resolving actions to install package 'Grunt.0.1.13'
    Resolved actions to install package 'Grunt.0.1.13'
    Retrieving package 'Grunt 0.1.13' from 'nuget.org'.
    Retrieving package 'Node.js 0.10.26.1' from 'nuget.org'.
    Retrieving package 'NoGit 0.0.5' from 'nuget.org'.
    Retrieving package 'Npm 1.4.4' from 'nuget.org'.
    Adding package 'Node.js.0.10.26.1' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Node.js.0.10.26.1' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Node.js.0.10.26.1' to 'packages.config'
    Executing script file 'D:\Bootstrap4\CompileCustomCSS\packages\Node.js.0.10.26.1\tools\install.ps1'...
    Successfully installed 'Node.js 0.10.26.1' to CompileCustomCSS
    Adding package 'NoGit.0.0.5' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'NoGit.0.0.5' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'NoGit.0.0.5' to 'packages.config'
    Executing script file 'D:\Bootstrap4\CompileCustomCSS\packages\NoGit.0.0.5\tools\install.ps1'...
    Successfully installed 'NoGit 0.0.5' to CompileCustomCSS
    Adding package 'Npm.1.4.4' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Npm.1.4.4' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Npm.1.4.4' to 'packages.config'
    Executing script file 'D:\Bootstrap4\CompileCustomCSS\packages\Npm.1.4.4\tools\install.ps1'...
    Successfully installed 'Npm 1.4.4' to CompileCustomCSS
    Adding package 'Grunt.0.1.13' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Grunt.0.1.13' to folder 'D:\Bootstrap4\CompileCustomCSS\packages'
    Added package 'Grunt.0.1.13' to 'packages.config'
    Executing script file 'D:\Bootstrap4\CompileCustomCSS\packages\Grunt.0.1.13\tools\install.ps1'...
    Successfully installed 'Grunt 0.1.13' to CompileCustomCSS
    Executing nuget actions took 2.43 sec
    Time Elapsed: 00:00:02.7712332
    ========== Finished ==========

    But I dont see any actual task being executed.



    • Edited by markgoldin Thursday, March 16, 2017 2:42 PM
    Thursday, March 16, 2017 1:47 PM
  • Hi markgoldin,

    >>If I dont have a project what kind of project for testing purposes would I create?

    My above reply tells you that we could install grunt from NuGet Manage, it has nothing to do with my project.

    And which type of your project, and what you want to do. In your first reply, you just share us install grunt from command line. Whether you are developing a web project and want to use Gruntfile? If yes, I think the following link maybe helpful for you.

    https://gruntjs.com/getting-started

    Please run your VS in Administrator, and open Package Manager Console, please refer to following screenshot:

    >>Also after creating a project add adding Gruntfile.js to it what do I do next?

    I could not understand what you want to do next?

    If I misunderstand you issue, please feel free to let me know. But I suggest you had better look over above link carefully.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 17, 2017 2:26 AM
    Moderator