Neovim COC - "node is not executable" - coc.nvim

(I am using ubuntu 18.04 WSL2 on the Windows 10 terminal emulator)
Hello, i am having problems with coc on Neovim. The coc plugin is installed correctly (with vim-plug), but when i started nvim a massege would appear "node is not executable", so, i changed the path in the init.vim folder, "let g:coc_node_path = 'C:/nodejs/node.exe'", but now another erro message appears " "C>/nodejs/node.exe" is not executable ", does someone know how to fix that?
My "init.vim" file and "plug-config" folder: https://github.com/user-d4ba/Files

In case anyone has my situation. I had node installed with node nvm/npm. The error never happened when I started nvim from the command line, only from the Application Menu (in KDE).
I got node's path with:
$ nvm which current
Then in init.nvm which was in ~/.config/nvim:
let g:coc_node_path = 'path'

You may not have installed node. Check to make sure you have - if you haven't, you can find install instructions and binaries on their GitHub, or use an applicable package manager if you prefer.
You can also reinstall it if you are not sure.

Related

Where can I find node.js interpreter

In WebStorm to get karma.conf running I need to configure it in a pop up window and enter the "path to the node.js interpreter".
(for some reason this information vanished after a restart)
Questions:
What is the path to the needed file?
Where is the node interpreter on Mac/Linux/Windows by default?
(I am on OS X)
Generally, on OSX and Linux, you can find any program with which program. In your case, type
which node
in terminal.
On windows command prompt
where node
On OSX if you've installed Node.js with brew:
/usr/local/bin/node
You can check the exact folder on your machine with the command which node
Important
When the finder opens on OSX, you won't be able to navigate to this path initially. You'll first need to navigate to the root folder e.g. Macintosh HD and then perform the keyboard shortcut Command + Shift + . (. = dot = period) to be able to select hidden files and folders.
Ubuntu:
sudo apt install nodejs
whereis nodejs
nodejs: /usr/bin/nodejs /usr/lib/nodejs /usr/include/nodejs /usr/share/nodejs /usr/share/man/man1/nodejs.1.gz
Configuring NodeJS Intepreter in IntelliJ:
File | Settings | Languages & Frameworks | Node.js and NPM
Node interpreter: Add... (select from the above path or add it)
/usr/bin/nodejs
Then, click on Enable button and select the modules.
On OSX:
/usr/local/bin/node
well I got it by myself, but wanted to share the answer, as I couldn't find it on google / stack overflow and hope to save somebody some time
This can be useful for someone. I tried all the previous methods on Linux Ubuntu 19.10, none worked, neither reinstalling nodejs. So I installed Webstorm via snap, with:
sudo snap install webstorm
sudo snap install webstorm --classic
And surprise, Nodejs was already configured in this version. Then I erased the webstorm version that I installed from Ubuntu Softwared.
That worked for me and was easy. Hope that can give you a clue.

I can’t autocomplete my Go code even after installing vim-gocode

My setup
I already installed gocode with the command go get github.com/nsf/gocode.
I use Pathogen to manage my Vim plugins. I installed vim-gocode with git clone git#github.com:Blackrush/vim-gocode.git.
What I’m seeing
The :Fmt command works ok, but I can’t autocomplete my golang code. It reports an error like in this image:
Can someone help me?
Please ensure you have YCM or neocomplete installed. You need some additional binaries to get all features. Following on the vim-go repo tells you how to install them.
All necessary binaries should be installed (such as gocode, godef, goimports, etc.). You can easily install them with the included :GoInstallBinaries command, by running command in your vim.

Vim74: E149 Sorry no help for help.txt

I just downloaded and installed vim74 on to my linux box. I'm only installing locally, for the user. When I go into vim, and do :help, I get the error.
I tried adding:
let $VIM='home/myuser/vim74'
let $VIMRUNTIME='home/myuser/vim74/runtime'
to my .vimrc but it didn't help. How can I fix this?
When building vim yourself and installing locally it seems that you need to generate the helptags manually from within vim since the build process doesn't seem to do it. I ran into this very same issue when building the latest vim version 8.0.311. I followed the link in Ben Klein's comment above, but both my &helpfile and &runtimepath were correct, yet I still received the E149 error when doing :help which I assume is your situation as well postelrich.
I found the helptags solution here:
https://github.com/Homebrew/homebrew-core/issues/1087
Even though I was installing vim locally on a centos system and not a mac, the issue seems to be universal. I just replaced $VIMRUNTIME with the path to the local vim runtime installed from make install, which in your case may be something like /home/myuser/vim74/runtime
Specifically I ran this from within vim:
:helptags ~/share/vim/vim80/doc
In your case you will probably run something like:
:helptags ~/vim74/runtime/doc
Once done, :help should immediately start working again without having to restart vim.
You can get the same “E149 Sorry no help for help.txt” error if you have a long-running Vim session and the Vim program files were upgraded in the meantime.
This happened to me: I had started an editing session in a GNU screen window on my Debian testing system using Vim 8.1. Some time later, unattenttended-upgrades upgraded Vim 8.1 to 8.2 with the result that the run-time paths were now no longer valid. I could have saved the session and restarted Vim, but it was simpler/easier to run the following command (specific to 8.2):
:set helpfile=/usr/share/vim/vim82/doc/help.txt

Could not start Tern server in Emacs

I have the latest version of Emacs and Tern but I have a problem with using the plugin. When I use any Tern-related commands I get this command from editor:
Wrong type argument: listp, "Could not start Tern server
env: node: No such file or directory.
"
As far as I know, Tern uses NodeJs to do it's job, I have the latest version of NodeJs also but I don't know why I get this error.
Add the following line to your init file, replacing the path for node if necessary depending on where node is installed:
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
I used to have the same problem and just make it work. The thing is that the plugin have hard coded tern-command path. So I modify the path to "/usr/local/bin/tern".
And because I install the plugin with emacs 24's package, I have to delete tern.elc in the plugin folder and recompile it by C-u 0 M-x byte-recompile-directory.

Node.JS - How to Run Node Command from any path?

I have installed the latest node.js from here . I see the %Path% variables have been set for Node.js. But, When i run node from C:\ , i get a "Node is not an recognized comman". But node command is working fine from "C:\Program Files (x86)\nodejs" path. Can i not run Node commands from C:\ or Say from an other path if i set the Env variables right? Please help. I am running a Win7 X64.
Thank You,
Faraaz
I had the exact same problem, but in my PATH variable I had: C:\Program Files\nodejs\.
After changing it to C:\Program Files\nodejs I could access it from anywhere.
What happens if you run node --version? I have never tried node.js from windows but if that doesn't work there is something wrong with your paths.
What do you get when you run echo %PATH%?
You should check if the path C:\Program Files (x86)\nodejs is present in your %PATH. If not, add it via the system properties (persistent change). In any case, restart your command prompt, it'll reload the %PATH variable. If you're lucky, it should work now :)
Most likely it happens because there is no Node path in your PATH environment variable.
I see two ways to solve this
Just add Node path into the end of PATH.
Reinstall Node as administrator
run 7-zip (or some file manager) with administrator privileges >>
browse to node-installer.msi >> open it, install node >> enjoy
My Sublime was working with Nodejs fine. I could press Alt-R and see the output from Node in Sublime. Then at some point I upgraded Sublime. I now have version 2.02 build 2221
And at some later point I tried Alt-R and got this infamous message
'node' is not recognized as an internal or external command
But it had worked, so what changed?
The steps I took to fix it were to install git bash and then
$ git clone https://github.com/tanepiper/SublimeText-Nodejs.git
$ cd SublimeText-Nodejs/
$ git checkout 095ba03344
Back in Sublime I clicked Preferences > Browse Packages. This opened up Windows Explorer with the folder:
C:\Users\me\AppData\Roaming\Sublime Text 2\Packages
I replaced the contents of the Nodejs folder with the git version. Re-started Sublime and then Alt-R sprang back into life.
Other things that turned out to be irrelevant were changing the file Nodejs.sublime-settings and tampering with system environment variables. The only thing that worked was 095ba03344 as described here
https://github.com/tanepiper/SublimeText-Nodejs/pull/39

Resources