Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module #59

Open
bmweiner opened this issue Jan 29, 2016 · 3 comments
Open

Error: Cannot find module #59

bmweiner opened this issue Jan 29, 2016 · 3 comments

Comments

@bmweiner
Copy link

I am trying to run a local server using Node on a Windows 8.1 machine. I can start the server with lightning-server, but there is an error thrown, when I try to view a session with a visualization:

$ uname
MINGW64_NT-6.3
$ pwd
/c/Users/name
$ lightning-server
Lightning started on port: 3000
Error: Cannot find module 'lightning-line' from 'C:\Users\name'
    at C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:46:17
    at process (C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server\node_modules\browserify\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

It appears that the module call is failing because it's looking in the current working directory rather than my node_modules directory.

If I run lightning-server from my npm folder, no errors are thrown (viz displays as expected).

alias lightning-server='cd $(cygpath $APPDATA/npm) && lightning-server'

Does lightning rely on any Node/NPM configs? I have node and npm on my path, but no environment variables set.

@mathisonian
Copy link
Member

hey @bmweiner,

lightning uses browserify under the hood to dynamically compile some modules. it looks like thats where things are breaking down.

browserify gets its path set here based on this config property.

what it should be doing is setting config.root to the directory wherever lighting was installed (in this case C:\Users\name\AppData\Roaming\npm\node_modules\lightning-server.

It looks like something wacky is happening with the paths on windows. i primarily dev on osx and linux, any help finding a solution is appreciated

@dazebug
Copy link

dazebug commented Jun 22, 2016

I had similar problem here.
I'm on the Ubuntu 14.04.4 LTS.

> lightning-server
Lightning started on port: 3000
Error: Cannot find module 'lightning-line' from '/home/username'
    at /home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
    at process (/home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
    at ondir (/home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
    at load (/home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
    at /home/username/.nvm/versions/node/v4.2.3/lib/node_modules/lightning-server/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

In this case, should I do same wacky trick you said before? @mathisonian

@mathisonian
Copy link
Member

Hey @dazebug what version of lightning-server do you have installed?

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

No branches or pull requests

3 participants