问题
I am running grunt cssmin it shows error
>> 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 Code part is given below.
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 version is 6.1.0 and npm version is 5.0.4 The grunt css min version is "grunt-contrib-cssmin": "^2.2.0"
I have seen similar errors and most of the answers are to upgrade the node version to 4 or more. My node version is 6.1.0. Any help would be great. Thanks...
回答1:
Path.isAbsolute was added in node v0.11.2
From your log it looks like you are still using Node v0.10.22
Process 'command 'C:...\nodejs\node-v0.10.22-windows-x64\bin\node.exe'
Double check your environment variables and update your path to point to the new v6.1.0 node \bin folder. Remove the old v0.10.22 version if you are no longer using it.
来源:https://stackoverflow.com/questions/44794105/grunt-task-uglify-errors-typeerror-object-object-has-no-method-isabsolut