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

Older version of Node.js is required #23

Open
wout opened this issue Jun 15, 2023 · 22 comments
Open

Older version of Node.js is required #23

wout opened this issue Jun 15, 2023 · 22 comments
Labels
upstream issue Issue is within a dependency

Comments

@wout
Copy link

wout commented Jun 15, 2023

An old version of Node.js (16) is required, which is reaching end-fo-life in September this year.

image

@rchl
Copy link
Member

rchl commented Jun 19, 2023

It's an issue with the underlying server (https://github.com/znck/grammarly) that it doesn't work with Node 18+. Feel free to report an issue there, if there isn't one already.

EDIT: There is one already: znck/grammarly#334

@rchl rchl added the upstream issue Issue is within a dependency label Jun 19, 2023
@larseggert
Copy link

Is there a way to tell the plugin which node installation to use? (I have node@16 installed via Homebrew, but can't figure out how to tell the plugin to use that instead of the system default.)

@rchl
Copy link
Member

rchl commented Aug 16, 2023

I think you could override command in LSP-Grammarly settings to:

"command": ["...path_to_node...", "${server_path}", "--stdio"]

Alternatively use the bundled Node version by setting "nodejs_runtime": ["local"] in Preferences: LSP Utils Settings.

@larseggert
Copy link

I tried to add "nodejs_runtime": ["local"] to LSP.sublime-settings, but that didn't help.

@rchl
Copy link
Member

rchl commented Aug 16, 2023

Add in Preferences: LSP Utils Settings (open from command palette).

@rchl
Copy link
Member

rchl commented Oct 19, 2023

I believe this means the end of this server soon: znck/grammarly#384 (comment)

@luispuerto
Copy link

I just updated to Sonoma, and this stopped working on my sublime. It is not incredibly important to me, but if I can make it work, life will be slightly easier. Is there any way to make the LSP-Grammarly aware that there is already a node.js operating in the system? In my case, it is not a PATH thing since the sublime has a correct path in its environment.

I can't find the Preferences: LSP Utils Settings on the command palette.

@predragnikolic
Copy link
Member

Hello @luispuerto,
Grammarly doesn't support node 18.

Rafal mention the fix in this comment.

If you have nvm
you can set the node version to 16, and copy the path:

λ  ~  nvm use 16
Your user’s .npmrc file (${HOME}/.npmrc)
has a `globalconfig` and/or a `prefix` setting, which are incompatible with nvm.
Run `nvm use --delete-prefix v16.16.0` to unset it.
λ  ~  node -v
v16.16.0
λ  ~  which node 
/home/predragnikolic/.nvm/versions/node/v16.16.0/bin/node

Than copy the last line,
And in the command palette select Preference: LSP-grammarly settings,
and edit the "command" setting:

{
	"command": [
		"/home/predragnikolic/.nvm/versions/node/v16.16.0/bin/node",
		"${server_path}",
		"--stdio"
	]
}

@luispuerto
Copy link

I'm wondering if I can do something similar with Homebrew

image

And installing Node16 and pointing grammarly to that version.

@luispuerto
Copy link

luispuerto commented Jan 7, 2024

I tried with hombrew and it fails:

{
  "command": [
    "/opt/homebrew/opt/node@16/bin/node",
    "${server_path}",
    "--stdio"
  ]
}
Screenshot 2024-01-07 at 11 05 50
Unable to start subprocess for grammarly
Traceback (most recent call last):
  File "/Users/luispuerto/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/windows.py", line 250, in start_async
    if plugin_class.needs_update_or_installation():
  File "/Users/luispuerto/Library/Application Support/Sublime Text/Lib/python33/lsp_utils/_client_handler/abstract_plugin.py", line 101, in needs_update_or_installation
    server = cls.get_server()
  File "/Users/luispuerto/Library/Application Support/Sublime Text/Lib/python33/lsp_utils/npm_client_handler.py", line 130, in get_server
    'skip_npm_install': cls.skip_npm_install,
  File "/Users/luispuerto/Library/Application Support/Sublime Text/Lib/python33/lsp_utils/server_npm_resource.py", line 49, in create
    raise Exception('Failed resolving Node.js Runtime. Please see Sublime Text console for more information.')
Exception: Failed resolving Node.js Runtime. Please see Sublime Text console for more information.

PS1/ I'm on macOS… so I really know what is going on with File "/Users/luispuerto/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/windows.py", line 250, in start_async.
PS2/ Node16 is correctly installed

image

@dsmaynard
Copy link

This fix doesn't work for me either (Arch Linux), even after specifying v16.0 in the LSP settings.

@luispuerto
Copy link

At least on my case the message is different form the OP's one. So perhaps I need to fix first the fact that seems that sublime is not able to reach any node.

@salleuska
Copy link

salleuska commented Jan 10, 2024

Hi, I had a similar problem and I was just able to make LSP-Grammarly start in Sublime by

  1. Uninstalling the latest version of Node.js from my Mac (which was 20something). [Not sure if this actually helped.]
  2. Following the advice here Language server can't start properly #4 (comment)

If you delete this folder: /[REDACTED]Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/18.3.0/
and sublime can't find nodejs, it will automatically download 16.15.0.

In my case I had LSP-Grammarly/16.15.0 which should have been the right version, so not sure why re-installing that made LSP-Grammarly restart. Hope it can help.

@luispuerto
Copy link

luispuerto commented Jan 10, 2024

I don't have ~/Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/ so I guess it has nothing to do with it, not to mention that other stuff depends on node current version.

The thing for me is make the package understand that there is another version of node and where is located.

PS/ In my case, it was working perfectly till I updated to Sonoma, and I haven't changed anything… so something is acting up.

@dsmaynard
Copy link

I don't have ~/Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/ so I guess it has nothing to do with it, not to mention that other stuff depends on node current version.

The thing for me is make the package understand that there is another version of node and where is located.

PS/ In my case, it was working perfectly till I updated to Sonoma, and I haven't changed anything… so something is acting up.

On my linux the corresponding location is .cache/sublime-text/Package\ Storage/LSP-Grammarly/, but deleting the folders still didn't help, so that's not a fix.

@luispuerto
Copy link

By the way… if my memory doesn't fail, I remember downloading the node for this package the first time I installed it… I mean is asked me if I wanted to download node. Where is that installation located? because perhaps something happened after the update.

Perhaps deleting everything solve the issue.

@salleuska
Copy link

salleuska commented Jan 10, 2024

I don't have ~/Library/Caches/Sublime Text/Package Storage/LSP-Grammarly/ so I guess it has nothing to do with it, not to mention that other stuff depends on node current version.

The thing for me is make the package understand that there is another version of node and where is located.

PS/ In my case, it was working perfectly till I updated to Sonoma, and I haven't changed anything… so something is acting up.

Got it. I realized that I still have a version of node (16.20.2) installed, so maybe uninstalling the latest one did not help (I'll update the answer). I was considering removing all versions of node and reinstalling the ones I needed. However, having sublime automatically install node 16.15.0 made LSP-Grammarly restart for me.

Anyway, I had this problem before updating to Sonoma (which I did two days ago), so there is still the chance that the same issue may have different causes.

@luispuerto
Copy link

Anyhow, @salleuska, today isn't the last day this will work correctly. (now that I reread the thread carefully)

I believe this means the end of this server soon: znck/grammarly#384 (comment)

I think that after today the package will no longer work properly for anyone.

Correct?

If you can confirm it tomorrow, that would be great, especially if you have Grammarly Pro.

@salleuska
Copy link

salleuska commented Jan 11, 2024

I have missed that. Indeed, today I opened Sublime and although LSP-Grammarly is still present I am now logged off from Grammarly and not able to log in again.

Anyway, I am still getting the suggestions from the free version.

@luispuerto
Copy link

So, there is no point in continuing to try to make this work. I already deleted the package.

@rchl
Copy link
Member

rchl commented Jan 11, 2024

Unless the original server at https://github.com/znck/grammarly starts being maintained properly again, I don't really see point in working on this either.

@predragnikolic
Copy link
Member

znck/grammarly repository has been archived by the owner on May 7, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream issue Issue is within a dependency
Projects
None yet
Development

No branches or pull requests

7 participants