Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

require issue #14

Open
lellisga opened this issue Nov 3, 2017 · 0 comments
Open

require issue #14

lellisga opened this issue Nov 3, 2017 · 0 comments

Comments

@lellisga
Copy link

lellisga commented Nov 3, 2017

I'm currently trying to compile this file:

// index.js
var events = require("events");
var EventEmitter = events.EventEmitter;

var myEmitter = new EventEmitter();

myEmitter.on('event', () => {
    console.log('an event occurred!');
});

myEmitter.emit('event');
java -jar ../closure/compiler-latest/closure-compiler-v20171023.jar 
        --externs './node.js-closure-compiler-externs-master/events.js' 
        --js index.js
        --js_output_file output/index-compiled.js 
        --compilation_level ADVANCED  
        --process_common_js_modules 
        --module_resolution NODE 
        --entry_point index.js 
        --warning_level VERBOSE

this is what I receive:

index.js:1: ERROR - Failed to load module "events"
var events = require("events");
    ^

index.js:1: ERROR - Failed to load module "events"
var events = require("events");
             ^

2 error(s), 0 warning(s)

Am I missing something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant