【问题标题】:grunt: I am having some errors in package.jsongrunt:我在 package.json 中有一些错误
【发布时间】:2015-09-26 18:08:22
【问题描述】:

我有 Task Run Explore 并在我的解决方案中安装了 grunt。我在 package.json 中遇到了一些错误,但我不明白,因为我曾经创建它 npm init。

错误是:

序列不包含任何元素:

Failed to run "C:\_DEVELOP\C#\my_circle\my_circle\package.json"...
Sequence contains no elements
Failed to run "C:\_DEVELOP\C#\my_circle\my_circle\Gruntfile.js"...
cmd.exe /c grunt -b "C:\_DEVELOP\C#\my_circle\my_circle" --gruntfile "C:\_DEVELOP\C#\my_circle\my_circle\Gruntfile.js" --tasks "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\TaskRunnerExplorer\Scripts" vs-grunt-task-reader

Failed to run "C:\_DEVELOP\C#\my_circle\my_circle\package.json"...
Sequence contains no elements

当我将组合更改为 0 时,使用 GruntFile.js。

在我安装的node_modules中:grunt-cli, grunt-contrib-jshint, grunt-contrib-uglify, grunt-contrib-watch,它们在项目级别的node_modules内。

我的 GruntFile.js 是:

/// <binding Clean='uglify, watch' />
module.exports = function ( grunt )
{
    var bannerContent = '/*********************************************************\n' +
                        ' my_circle ' +
                        ' ==> Fecha subida:' +
                        ' <%= grunt.template.today("dd-mm-yyyy hh:MM") %>\n ' +
                        '*********************************************************/\n\n';

    //definir las tareas
    grunt.initConfig( {

        uglify: {
            options: {
                spawn: false,
                compress: false,
                mangle: false,
                beautify: true,
                banner: bannerContent
            },
            js: {
                src: ["Scripts/*.js"],
                dest: "Scripts/output.min.js"
            }
        }


    } );
    //para cargar los plugins 
    grunt.loadNpmTasks( 'grunt-contrib-uglify' );

    //registrar los plugins a las tareas por defecto. si ejecuto grunt ejecuta por orden los siguientes plugins.
    grunt.registerTask( 'default', ['uglify'] );
};

我的代码和 package.json 有什么问题?

【问题讨论】:

    标签: gruntjs


    【解决方案1】:

    根据 Mads Kristensen 的说法,这是一个错误: https://github.com/madskristensen/NpmTaskRunner/issues/12

    我已调查此问题,但无法通过此扩展程序解决此问题。问题出在 Task Runner Explorer 可扩展性代码上,我在 VS Web 团队上打开了一个内部错误 (176952) 来修复它。在这里关闭它。

    我看到了同样的行为

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多