Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

Fixes compatibility with Node.js 8. #728

Closed
wants to merge 1 commit into from

Conversation

austinkelleher
Copy link

When using on Node 8, I receive the following error:

/Proj/node_modules/require-dir/index.js:97
            if (!require.extensions.hasOwnProperty(ext)) {
                                    ^

TypeError: require.extensions.hasOwnProperty is not a function
    at requireDir (/Proj/node_modules/require-dir/index.js:97:37)
    at loadOfficialExtensions (/Proj/node_modules/laravel-elixir/dist/bootstrap/LoadExtensions.js:15:27)
    at Object.<anonymous> (/Proj/node_modules/laravel-elixir/dist/bootstrap/LoadExtensions.js:30:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)

This is because Node.js 8 does not supper hasOwnProperty on require.extension. After further inspection, this issue has been fixed in aseemk/requireDir#46. The only caveat to using the latest version of require-dir is that it dropped support for the already deprecated Node.js version 0.10 and 0.11. I'm not sure if you're still supporting these versions, but if so, it should be a major version bump.

/cc @JeffreyWay

@zhuangya
Copy link
Contributor

i filed same PR in #723 three month ago, but no one is responding :(

@austinkelleher
Copy link
Author

@zhuangya Thanks for following up about this. I took a brief look at the PRs to see if anyone else had opened this same PR, but I must of overlooked yours. I will go ahead and close out this issue in favor of yours.

@austinkelleher austinkelleher deleted the node-8-support branch September 19, 2017 12:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants