actum / gulp-dev-stack

Actum dev stack based on gulp
MIT License
11 stars 7 forks source link

requireDiv does not work with Node v8 #197

Closed fidelman closed 6 years ago

fidelman commented 6 years ago

When you try to run any gulp task, you can face up

/Users/afidelman/Web/kadena-k10-core/frontend/node_modules/require-dir/index.js:97
            if (!require.extensions.hasOwnProperty(ext)) {
                                    ^
TypeError: require.extensions.hasOwnProperty is not a function

when you try to reinstall the require-dir module

WMCM361:frontend afidelman$ yarn add require-dir --dev
yarn add v1.5.1
warning package.json: No license field
warning kadena@2.0.0: No license field
[1/5] 🔍  Validating package.json...
error kadena@2.0.0: The engine "node" is incompatible with this module. Expected version "7.8.0".
error An unexpected error occurred: "Found incompatible module".

The current node version 8.10.0 and can we make up a solution except downdating node?

fidelman commented 6 years ago

Temporarily fixed on my machine. Instead of requireDir(path) Added

const normalizedPath = require('path').join(__dirname, './gulp/tasks');

require('fs').readdirSync(normalizedPath).forEach(function(file) {
  require('./gulp/tasks/' + file);
});
fidelman commented 6 years ago

solved, just updated requireDiv/yarn/npm