cubevizjs icon indicating copy to clipboard operation
cubevizjs copied to clipboard

TypeError: require.extensions.hasOwnProperty is not a function

Open howff opened this issue 4 years ago • 2 comments

I just tried this project by following the instructions to npm install and npm start but got an error:

npm start

> [email protected] start /home/src/cubevizjs
> gulp

/home/src/cubevizjs/node_modules/require-dir/index.js:93
            if (!require.extensions.hasOwnProperty(ext)) {
                                    ^

TypeError: require.extensions.hasOwnProperty is not a function
    at requireDir (/home/src/cubevizjs/node_modules/require-dir/index.js:93:37)
    at Object.<anonymous> (/home/src/cubevizjs/node_modules/gulp-git/index.js:4:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/src/cubevizjs/gulpfile.js:3:11)

npm ERR! Linux 5.3.0-42-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `gulp`
npm ERR! Exit status 1

I found this https://robertwray.co.uk/blog/gulp-node-js-and-require-extensions-hasownproperty-is-not-a-function

which describes changing

if (!require.extensions.hasOwnProperty(ext)) {

to

if (!Object.prototype.hasOwnProperty.call(require.extensions, ext)) {

That seemed to work

howff avatar Apr 23 '20 10:04 howff

Hi @howff, thank you for the report.

@GeorgesAlkhouri: What do you think?

k00ni avatar Apr 28 '20 07:04 k00ni

Sorry, currently I have no time to look into this.

GeorgesAlkhouri avatar May 07 '20 18:05 GeorgesAlkhouri