Gruntjs 找不到GrunFile.js grunt contrib uglify

Gruntjs 找不到GrunFile.js grunt contrib uglify,gruntjs,Gruntjs,我刚接触格伦特,但仍能找到自己的脚 我已经安装了咕噜和丑陋的 npm install grunt-contrib-uglify --save-dev 我在gruntfile.js中有以下内容来测试缩小css文件 // Code example 01-minify module.exports = function(grunt) { // Load the plugin that provides the "uglify" task. grunt.loadNpmTasks('g

我刚接触格伦特,但仍能找到自己的脚

我已经安装了咕噜和丑陋的

npm install grunt-contrib-uglify --save-dev
我在gruntfile.js中有以下内容来测试缩小css文件

  // Code example 01-minify
  module.exports = function(grunt) {

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');

  // Project configuration.
  grunt.initConfig({
    uglify: {
        target1: {
            src: 'styles.css',
            dest: 'styles.min.css'
        }
    }
  });
  // Define the default task
  grunt.registerTask('default', ['uglify']);
  };
如果我运行
grunt
,我会

  Local Npm module "grunt-contrib-uglify" not found. Is it installed?
  Warning: Task "uglify" not found. Use --force to continue.
您是否在与GrunFile相同的文件夹中运行了“npm安装…”?该位置是否有node_模块文件夹?