AKSW / cubevizjs

CubeViz.js is the successor of the CubeViz and provides statistical data exploration and visualization. Its completely written in JavaScript.
Other
16 stars 4 forks source link

TypeError: require.extensions.hasOwnProperty is not a function #28

Open howff opened 4 years ago

howff commented 4 years ago

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

npm start

> Project@0.2.0 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! Project@0.2.0 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

k00ni commented 4 years ago

Hi @howff, thank you for the report.

@GeorgesAlkhouri: What do you think?

GeorgesAlkhouri commented 4 years ago

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