“Fatal error: Unable to find local grunt.” when running “grunt” command

前端 未结 7 568
猫巷女王i
猫巷女王i 2021-01-30 08:11

I uninstalled grunt with following command.

npm uninstall -g grunt

Then I again installed grunt with following command.

npm ins         


        
7条回答
  •  情深已故
    2021-01-30 08:56

    You have to install grunt in your project folder

    1. create your package.json

      $ npm init
      
    2. install grunt for this project, this will be installed under node_modules/. --save-dev will add this module to devDependency in your package.json

      $ npm install grunt --save-dev
      
    3. then create gruntfile.js and run

      $ grunt 
      

提交回复
热议问题