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 when using "idea" in alfred #15

Closed
tjosinga opened this issue Apr 16, 2019 · 9 comments
Closed

Error when using "idea" in alfred #15

tjosinga opened this issue Apr 16, 2019 · 9 comments
Assignees

Comments

@tjosinga
Copy link

Q A
Workflow version 1.0.9
OSX Version 10.14.4
Alfred Version 3.8.1
JetBrains Product/Version IntelliJ / 2019.1
Installation type JB Toolbox

Description

In the terminal, the command-line idea ./ works perfectly, but not when using Alfred. I get an "Unexpected token ..." error in Alfred, which I can copy:

/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/src/product.js:42
            ...product,
            ^^^
SyntaxError: Unexpected token ...
    at Object.<anonymous> (/usr/local/lib/node_modules/@bchatard/alfred-jetbrains/src/index.js:7:38)

-
JetBrains - Open Project - v3 1.0.9
Alfred 3.8.1
darwin x64 18.5.0

In another issue you requested the content of the idea file. In my case it is:

$> cat $(which idea)

#!/bin/sh
# Generated by JetBrains Toolbox 1.14.5179 at Mon Apr 15 16:37:15 2019

open -a "/Users/taco/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/191.6183.87/IntelliJ IDEA.app/Contents/MacOS/idea" "$@"

Step to reproduce

Just by typing idea in Alfred.

@bchatard
Copy link
Owner

Hi @tjosinga
which version of nodejs do you have?

@bchatard bchatard self-assigned this Apr 16, 2019
@tjosinga
Copy link
Author

tjosinga commented Apr 16, 2019

Both v6.14.3 and v11.14.0 in NVM. I have set the latter as default, but maybe the problem is that Alfred is not using the correct version?

@tjosinga
Copy link
Author

$> nvm use system
Now using system version of node: v11.12.0 (npm v6.7.0)

The system version seems to be 11.12.

@bchatard
Copy link
Owner

ok, I'm not familiar with NVM.
Can you try to add the following line in the "idea script filter": ./node_modules/.bin/run-node --version

⚠️ Heavy GIF ⚠️
Kapture 2019-04-16 at 10 57 09

@tjosinga
Copy link
Author

tjosinga commented Apr 16, 2019

Aaa, yes, Alfred uses v6.14.3.

So I tried installing a new version of node.js as system version (without nvm), using the instructions on: https://solarianprogrammer.com/2016/04/29/how-to-upgrade-nodejs-mac-os-x/
That didn't do the trick, yet (also restarted Alfred), though I saw some differences (maybe I was too quick).

Then I noted that there is a new version 1.0.10, so I removed 1.0.9 and installed 1.0.10, and it worked.

@tjosinga
Copy link
Author

So in short, when using NVM one may think he is using a recent version of node.js (based on the output in shell), but in fact, it may be an old version.

@bchatard
Copy link
Owner

o_O I did not change stuff on this in 1.0.10...

I know that Alfred doesn't export your path, but a "lighter one" maybe it's related. I use Alfy under the hood, which handle this case (sindresorhus/alfy#73 (comment))

bchatard added a commit that referenced this issue May 2, 2019
@bchatard
Copy link
Owner

bchatard commented May 5, 2019

Hi @tjosinga,

I add a validation of node version at the begin of the process. It will be more easier to debug.

Thanks for your help

@tjosinga
Copy link
Author

tjosinga commented May 6, 2019

👍

@tjosinga tjosinga closed this as completed May 6, 2019
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

2 participants