You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
underscore does not have an index.js at the module root. Instead, the entry point is configured via main attribute in package.json
> require('chance')
Fetching and installing module 'chance' from npm...
Done!
[Function: Chance] { Chance: [Circular] }
> require('underscore')
Fetching and installing module 'underscore' from npm...
Done!
Uncaught:
Error: Cannot find module '/Users/deepal/.baapan/workspace_90531_1584193257750/node_modules/underscore'
Require stack:
- <repl>
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at Module._module.Module.require (/Users/deepal/Projects/baapan/src/baapan.js:131:34)
at require (internal/modules/cjs/helpers.js:77:18) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '<repl>' ]
}
>
This happens if the require() has been called once to install a module dynamically. Installation of the second module is successful, but it cannot be required and throws MODULE_NOT_FOUND error.
This issue is specific to Node v12.16.0 and above.
deepal
changed the title
Cannot install a module without an index.js at root after require() has been called once
Node v12.x.x Cannot install a module without an index.js at root after require() has been called once
Mar 14, 2020
deepal
changed the title
Node v12.x.x Cannot install a module without an index.js at root after require() has been called once
Node >v12.x.x Cannot install a module without an index.js at root after require() has been called once
Mar 14, 2020
deepal
changed the title
Node >v12.x.x Cannot install a module without an index.js at root after require() has been called once
Node >= v12.16.0 Cannot install a module without an index.js at root after require() has been called once
Mar 15, 2020
Steps to reproduce:
chance
firstunderscore
secondunderscore
does not have anindex.js
at the module root. Instead, the entry point is configured viamain
attribute inpackage.json
This happens if the
require()
has been called once to install a module dynamically. Installation of the second module is successful, but it cannot berequire
d and throwsMODULE_NOT_FOUND
error.This issue is specific to Node v12.16.0 and above.
This issue is due to nodejs/node#29492
The text was updated successfully, but these errors were encountered: