Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

ReferenceError: exports is not defined #20

Open
mathk opened this issue Feb 22, 2016 · 3 comments
Open

ReferenceError: exports is not defined #20

mathk opened this issue Feb 22, 2016 · 3 comments

Comments

@mathk
Copy link

mathk commented Feb 22, 2016

When trying to execute an node 'express' application I have the following issue:

var app = exports = module.exports = {};
^

ReferenceError: exports is not defined
at /Users/mathk/git/expresstest/node_modules/express/lib/application.js:37:19
at Object.exports.runInContext (vm.js:44:17)
at sbRequire (/Applications/LightTable.app/Contents/Resources/app/plugins/Javascript/node/ltnodeclient.js:99:10)

To reproduce:

$ mkdir test
$ node init
$ npm install express --save

Create a file app.js:

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!');
});

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});

Then add a new connection in LT using the app.js.

Environment:
LT: 0.8.1
OS: OSX 10.11.3
Node: 5.6.0 ( Tested with 4.3.1 and 0.12.7 as well)

@kenny-evitt
Copy link
Contributor

Previously reported as LightTable/LightTable#2146.

@kenny-evitt
Copy link
Contributor

@mathk Is your third step an npm command?

@mathk
Copy link
Author

mathk commented Feb 24, 2016

yes that is a typo sorry, fixed

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

2 participants