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

iron-node do not work / starts with an error #104

Closed
weingaunity opened this issue May 14, 2016 · 21 comments
Closed

iron-node do not work / starts with an error #104

weingaunity opened this issue May 14, 2016 · 21 comments

Comments

@weingaunity
Copy link

i installed with

npm install -g iron-node

and tried a simple file including a "debugger;" statement.

i call it with "iron-node ./test.js" and a dialog-error pops up:

Starting iron-node without further arguments also creates the same error message.

A JavaScript error occurred in the main process

Uncaught Exception:
TypeError: app.getPath is not a function
at Config (/usr/local/lib/node_modules/iron-node/app/config.js:56:35)
at initializeApplication (/usr/local/lib/node_modules/iron-node/app/index.js:35:41)
at EventEmitter. (/usr/local/lib/node_modules/iron-node/app/index.js:48:15)
at emitOne (events.js:95:20)
at EventEmitter.emit (events.js:182:7)

Do you have any idea how to solve this issue?

My system is Ubuntu 16.04 LTS 64-bit.

Thx.

@dasilvacontin
Copy link

Same here. Maybe related to the electron upgrade.

screenshot 2016-05-14 12 36 03

@s-a s-a closed this as completed in 83b98b9 May 14, 2016
@s-a
Copy link
Owner

s-a commented May 14, 2016

Yes this belongs to electron 1 migration. I use app/config.js in main and in render process. So the app var needs to init differently. Just published 3.0.2. Hope this helps.

@weingaunity
Copy link
Author

No, still the same issue.

I updated to 3.0.2

/usr/local/bin/iron-node -> /usr/local/lib/node_modules/iron-node/bin/run.js
/usr/local/lib
└── iron-node@3.0.2

In use:
electron-recompile@1.0.16

@s-a s-a reopened this May 14, 2016
@s-a
Copy link
Owner

s-a commented May 14, 2016

Weird it works on windows. Can you try to debug config.js to see whats going on ?

@weingaunity
Copy link
Author

How to debug? I'm try to find a debug tool and want to try iron-node..... :-)

Uncaught Exception:
TypeError: app.getPath is not a function
at Config (/usr/local/lib/node_modules/iron-node/app/config.js:56:35)
at initializeApplication (/usr/local/lib/node_modules/iron-node/app/index.js:35:41)
at EventEmitter. (/usr/local/lib/node_modules/iron-node/app/index.js:48:15)
at emitOne (events.js:95:20)
at EventEmitter.emit (events.js:182:7)

@s-a
Copy link
Owner

s-a commented May 14, 2016

OK you can install ironNode versions below 3 to make it work. I will setup an Ubuntu machine the next days.

@s-a
Copy link
Owner

s-a commented May 15, 2016

I cannot reproduce this on Ubuntu 14.04.

can you compare contents of your path /usr/local/lib/node_modules/iron-node/app/config.js with

iron-node/app/config.js

Lines 6 to 11 in b5a4ce0

var app;
if (require('electron').remote){
app = require('electron').remote.app;
} else {
app = require('electron');
}
?

image

@s-a s-a added need feedback and removed bug labels May 15, 2016
@johanalkstal
Copy link

johanalkstal commented May 15, 2016

I just installed iron-node on my Windows 10 machine and I'm getting the same error.

iron-node

@weingaunity
Copy link
Author

/usr/local/lib
└─┬ iron-node@3.0.2
└── electron-prebuilt@1.0.2

I compared both files and they are equal.

Error still exists.

Old Version 2.x works.

@s-a
Copy link
Owner

s-a commented May 15, 2016

It sounds for me like you have a version mismatch on your machine. Old electron and new ironNode or vice versa. _Maybe a global installed electron module?_ Regarding nvm users reported such an error in the past. In fact I got the same error message while migrating to electron 1 but fixed with code changes in config.js.

@s-a s-a removed the Linux label May 15, 2016
@s-a
Copy link
Owner

s-a commented May 16, 2016

I recently installed on 3 different machines. I close this issue unless it is reproducable.

@s-a s-a closed this as completed May 16, 2016
@okcoker
Copy link

okcoker commented May 17, 2016

This happened for me as as well on OSX 10.11.

Installing npm install -g iron-node@2.x worked for me though.

Which is a shame because #98 also applies to me.

@s-a
Copy link
Owner

s-a commented May 17, 2016

I finaly found a workstation where I have the same issue

@s-a s-a reopened this May 17, 2016
@s-a
Copy link
Owner

s-a commented May 17, 2016

I resolved it with

$ npm uninstall -g iron-node;
unbuild iron-node@3.0.3

$ npm install -g iron-node;

@s-a
Copy link
Owner

s-a commented May 17, 2016

This works only for current terminal session. I think this is NPM related.

)npm -v
2.14.20

@s-a
Copy link
Owner

s-a commented May 17, 2016

it could be related to npm/npm#12654

@okcoker
Copy link

okcoker commented May 17, 2016

Thanks for looking into this @s-a

I am indeed on newer node/npm

npm -v
3.8.6
node -v
v6.1.0

@s-a
Copy link
Owner

s-a commented May 17, 2016

Some one tried to clone and install from repo?

@enter801
Copy link

I cloned and tried to install locally. Did it with npm link in the iron-node folder, then npm link iron-node in my project folder. It runs, but still get the error. Installing pointing to iron-node as a directory, ie. npm install ./iron-node gave the same result. I'm on OSX 10.11.3.

@s-a s-a closed this as completed in fddd48e May 18, 2016
@s-a
Copy link
Owner

s-a commented May 18, 2016

i removed the app reference from code. pls check if the global config folder determies correct in v3.0.4 on non windows systems

@okcoker
Copy link

okcoker commented May 18, 2016

Boom! Seems to work on OSX. Thanks @s-a

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

6 participants