【发布时间】:2017-12-01 07:45:43
【问题描述】:
我正在运行 grunt cssmin 它显示错误
>> TypeError: Object #<Object> has no method 'isAbsolute'
Warning: CSS minification failed at node_modules/bootstrap/dist/css/bootstrap.mi
n.css. Use --force to continue.
Aborted due to warnings.
:
grunt_default F
AILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':grunt_default'.
> Process 'command 'C:...\nodejs\node-v0.10.22-windows-x64\bin\node.exe'' finished with non-zero exit value 6
Grunt 代码部分如下。
cssmin:{
main:{
files:[{
expand: true,
cwd: 'node_modules/bootstrap/dist/css',
src: '**/bootstrap.min.css',
dest: 'css'
},{
expand: true,
cwd: 'node_modules/angular-ui-grid',
src: '**/ui-grid.min.css',
dest: 'css'
}]
}
},
Node 版本是 6.1.0,npm 版本是 5.0.4 grunt css min 版本是 "grunt-contrib-cssmin": "^2.2.0"
我看到过类似的错误,大部分答案都是将节点版本升级到4或更高。我的节点版本是 6.1.0。任何帮助都会很棒。谢谢...
【问题讨论】: