Error: Cannot find module 'time-grunt'

前端 未结 3 1082
孤城傲影
孤城傲影 2021-02-19 03:41

I try install time-grunt local and global, clear npm cache, update npm, but nothing helps. I get:

 Loading \"Gruntfile.js\" tasks...ERROR
 Error: Cannot find mod         


        
3条回答
  •  忘掉有多难
    2021-02-19 04:41

    You need to add it inside dependencies and not within devDependencies. This way you don't need to separately run $ npm install --save-dev time-grunt

    {
      "name": "grunt-build",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "time-grunt": "^1.3.0"
      },
      "devDependencies": {
        "grunt": "^0.4.5",
        "grunt-contrib-clean": "~0.7.0",
        "grunt-contrib-compress": "~0.5.0",
        "grunt-contrib-concat": "~0.5.0",
        "grunt-contrib-copy": "^0.8.0",
        "grunt-contrib-uglify": "~0.5.0",
        "grunt-remove-logging": "~0.2.0"
      }
    }
    

提交回复
热议问题