coolwanglu / neovim-e

Electron UI for Neovim
MIT License
271 stars 29 forks source link

Cannot find module 'app' #60

Closed pysnow530 closed 7 years ago

pysnow530 commented 7 years ago

I run electron . on mac, seems neovim-e don't want to talk to me, and give me an exception.

Who could help me?

~/repos/neovim-e $ electron .
App threw an error during load
Error: Cannot find module 'app'
    at Module._resolveFilename (module.js:440:15)
    at Function.Module._resolveFilename (/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/pysnow530/repos/neovim-e/src/launcher.js:4:9)
    at Object.<anonymous> (/Users/pysnow530/repos/neovim-e/src/launcher.js:34:4)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
pysnow530 commented 7 years ago

After run npm install app, the error changed as follow:

App threw an error during load
TypeError: core.require is not a function
    at Object.<anonymous> (/Users/pysnow530/repos/neovim-e/node_modules/app/lib/App.js:10:18)
    at Object.<anonymous> (/Users/pysnow530/repos/neovim-e/node_modules/app/lib/App.js:356:4)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/pysnow530/repos/neovim-e/node_modules/app/lib/index.js:3:29)
krzysztofantczak commented 7 years ago

launcher.coffee:

electron = require 'electron'
app = electron.app
BrowserWindow = electron.BrowserWindow

grunt && electron .

cgarciaq commented 7 years ago

+1 (exactly the same message). krzysztofantczak solution didn't work for me

krzysztofantczak commented 7 years ago

@cgarciaq i think it's just more errors, right? different ones, those need to be fixed as well. I had to fix like (afair) 7 files in total to make that work, but it works ;-)

electron documentation with latest API is helpfull here

cgarciaq commented 7 years ago

Hmm... I'm not sure, but the error seems very similar, except for some line numbers.

A JavaScript error occurred in the main process Uncaught Exception: Error: Cannot find module 'app' at Module._resolveFilename (module.js:455:15) at Function.Module._resolveFilename (/usr/local/lib/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/carlos/neovim-e/src/launcher.js:4:9) at Object. (/home/carlos/neovim-e/src/launcher.js:34:4) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32)

cgarciaq commented 7 years ago

--> uname -a Linux xxxxx 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

--> nvim -v NVIM 0.1.6-dev Build type: RelWithDebInfo Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/build/config -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/src -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/.deps/usr/include -I/usr/include -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/build/src/nvim/auto -I/build/neovim-TW_bde/neovim-0.1.5ubuntu1+git201610061357+2804+21~ubuntu16.04.1/build/include Compilado por buildd@lcy01-01

Optional features included (+) or not (-): +acl +iconv +jemalloc +tui
For differences from Vim, see :help vim-differences

pysnow530 commented 7 years ago

@krzysztofantczak solution worked

now the result changed to:

win.loadUrl is not a function
TypeError: win.loadUrl is not a function
    at App.<anonymous> (/Users/jianming.wu/repos/neovim-e/src/launcher.js:33:16)
    at emitOne (events.js:101:20)
    at App.emit (events.js:188:7)
pysnow530 commented 7 years ago

@krzysztofantczak thank you very much, fixed!

but when neovim-e launched, it is blank???

pysnow530 commented 7 years ago

@krzysztofantczak

After I modify some coffee, all is ok now, thank you very much!