npm - “警告:“路径”参数必须是字符串类型使用 --force 继续。”
问题描述
当我尝试在新的开发安装上运行 grunt 时收到此错误:
"Warning: The "path" argument must be of type string Use --force to continue."
这是我的gruntfile.js
样子。我已经排除了不正确的路径,还有什么可能导致这种情况以及如何确定坏路径的位置?
module.exports = function (grunt) {
'use strict';
// Load all grunt tasks
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );
// Project configuration
grunt.initConfig( {
pkg : grunt.file.readJSON( 'package.json' ),
concat: {
options : {
stripBanners: true,
banner : '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n'
},
jdrf_promise: {
src : [
'assets/js/src/jdrf_promise.js',
'assets/js/src/promise_map.js'
],
dest: 'assets/js/jdrf_promise.js'
}
},
jshint: {
browser: {
options: {
jshintrc: '.jshintrc',
reporter: require( 'jshint-stylish' )
},
src : [
'assets/js/src/*.js'
]
}
},
uglify: {
all: {
files : {
'assets/js/jdrf_promise.min.js': ['assets/js/jdrf_promise.js'],
'assets/js/promise_map.min.js' : ['assets/js/promise_map.js']
},
options: {
banner : '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n',
mangle : false,
beautify : false,
semicolons: true
}
}
},
test : {
files: ['assets/js/test/**/*.js']
},
compass: {
dev: {
options: {
sassDir : ['assets/css/sass'],
cssDir : ['assets/css'],
environment: 'development',
outputStyle: 'expanded'
}
},
dist: {
options: {
sassDir: 'assets/css/sass',
cssDir : 'assets/css/'
}
}
},
cssmin : {
options: {
banner: '/*! <%= pkg.title %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n'
},
minify : {
expand: true,
cwd: 'assets/css',
src: ['jdrf_promise.css'],
dest: 'assets/css',
ext : '.min.css'
}
},
watch : {
compass: {
files: ['assets/css/sass/*.scss', 'assets/css/sass/*/*.scss'],
tasks: ['compass:dev']
},
styles: {
files: ['assets/css/jdrf_promise.css'],
tasks: ['cssmin']
},
scripts: {
files : ['assets/js/src/**/*.js', 'assets/js/vendor/**/*.js'],
tasks : ['jshint', 'concat', 'uglify'],
options: {
debounceDelay: 500
}
}
}
} );
//Dependent plugins
grunt.loadNpmTasks( 'grunt-contrib-compass' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
// Default task.,
grunt.registerTask( 'default', ['jshint', 'concat', 'uglify', 'compass:dev', 'cssmin' ] );
grunt.util.linefeed = '\n';
};
解决方案
推荐阅读
- tfs - 选择项目组之前的 TFS 第一页(登陆页)
- ionic-framework - 离子标签自动加载,无需点击
- vb.net - 如何转换 FTP Getlisting 字符串数组的编码?
- pandas - 根据索引 pandas 替换值
- c# - ASP.NET MVC 5 - 返回特殊错误页面而不是自定义错误页面
- javascript - 在 Leaflet.GeoJSON 中处理 JSON 响应
- jenkins - jenkins maven 元数据插件,使用参数构建不起作用
- c - 指针指向不同的数据类型
- excel - VBA 多值查找和替换,但也突出显示替换的单元格
- ssh - shh 连接到家用路由器