-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.
Description
- Version: 6.0.0-rc.2 / master
- Platform: Linux 4.5.0-302.fc24.x86_64 deps: update openssl to 1.0.1j #1 SMP Wed Mar 30 15:41:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: module
I discovered this bug while trying to run pm2 with v6.0.0-rc.2.
To repro, create the following directory structure:
test
test/test.js
test/node_modules/a/package.json
test/test.js:
require('a/');test/node_modules/a/package.json:
{
"main": "doesnotexist"
}Then execute test/test.js.
Result with v5.10.1:
module.js:341
throw err;
^
Error: Cannot find module 'a/'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/home/mzasso/test/test.js:1:63)
Result with v6.0.0-rc.2 / master:
module.js:128
for (var i = 0; i < exts.length; i++) {
^
TypeError: Cannot read property 'length' of undefined
at tryExtensions (module.js:128:27)
at tryPackage (module.js:107:10)
at Function.Module._findPath (module.js:182:18)
at Function.Module._resolveFilename (module.js:434:25)
at Function.Module._load (module.js:384:25)
at Module.require (module.js:464:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/home/mzasso/test/test.js:1:63)
I'm working on a fix right now.
fusepilot and popomore
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.