I have a problem in a grunt project. I was using node.js 8.x and it worked fine.
After I update node.js to 14.x I got this error.
Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
Here is the grunt file :
module.exports = function (grunt) {
var tasks = { scope: ['devDependencies', 'dependencies'] };
var options = {
config: { src: "../../base/grunt/*.js" },
pkg: grunt.file.readJSON('package.json')
};
var configs = require('load-grunt-configs')(grunt, options);
require('load-grunt-tasks')(grunt, tasks);
grunt.initConfig(configs);
grunt.registerTask('build', [
'copy', 'sass', 'concat', 'cssmin', 'uglify'
]);
grunt.registerTask('deploy', [
'build',
'ftp-deploy:uploadToCDN'
]);
grunt.registerTask('watcher', [
'build',
'watch'
]);
grunt.registerTask('site-push', ['copy:importLar', 'liferaySiteGenerate:zipLar']);
grunt.registerTask('struct-push', ['copy:importStruct', 'liferayStructureGenerate:deployStructures']);
grunt.registerTask('templates-push', ['copy:importTemplates', 'liferayTemplateGenerate:deployTemplates']);
};
Here is the function to copy function :
module.exports = function () {
return {
importJavascript: {
src: "node_modules/@axiellarena/**/dist/*.dist.js",
dest: "src/js/",
filter: "isFile",
flatten: true,
expand: true,
rename: function (dest, src) {
let start = src.indexOf('js/');
let end = src.length;
return dest + '_arena-' + src.substring(start, end);
}
},
importScss: {
src: ["node_modules/@axiellarena/**/dist/**/*.scss"],
dest: "src/styles/arena-import/",
filter: "isFile",
flatten: false,
expand: true,
rename: function (dest, src) {
let start = src.indexOf('dist/') + 5;
let end = src.length;
return dest + src.substring(start, end);
}
},
exportScss: {
src: ["src/styles/**/*.scss"],
dest: "dist/<%= pkg.path %>/",
flatten: false,
expand: true,
rename: function (dest, src) {
let start = src.indexOf('styles/') + 7;
let end = src.length;
return dest + src.substring(start, end);
}
},
exportStruct: {
src: ["src/resources/*"],
dest: "dist/struct/<%= pkg.path %>",
flatten: true,
expand: true
},
exportTemplate: {
src: ["src/resources/*"],
dest: "dist/templates/<%= pkg.path %>",
flatten: true,
expand: true
},
exportSite: {
src: ["**"],
cwd: 'src/resources/lar/',
dest: "dist/lar/",
expand: true
}
};
};
I got the following error:
Running "build" task (node:11400) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) Running "copy" task > No "copy" targets found. Warning: Task "copy" failed. Use --force to continue.