rubenv / grunt-mkdir

Create directories with Grunt.
MIT License
16 stars 5 forks source link

Issue with node 14 #7

Open f-lehmann-gmx-de opened 4 years ago

f-lehmann-gmx-de commented 4 years ago

When you exchange your project to node 14 and latest grunt version and you use grunt-mkdir, in that case you have to set the mode. Without the mode the system is not able to create the directories. Looks like with node 14 the umask is not per default 0700. eg. which is working in your code

            options: {
                mode: 0777,   <====== required now but the number can be different e.g. 0700...
                create: ['./tmp/a']
            }
MarkusDeutschmann commented 3 years ago

I think it is because node 14 handles null differently: https://github.com/nodejs/node/pull/32726

To fix the issue and restore the old behavior for NodeJS 14 the 4th line of src/mkdir.coffee must be changed from mode: null to mode: undefined

That will then change the 5th line in the generated tasks/mkdir.js file from mode: null, to mode: void 0,

That seems to be enought to make it work again in NodeJS 14 again.

To make it also able to run the grunt build & grunt test commands also the used grunt-mocha-cli package needs to be updated: "grunt-mocha-cli": "^1.14.0"