Node executable can't be found in Visual Studio Code - node.js

I'm using Visual Studio Code to (try to) debug my node.js scripts. On the moment I want to debug my index.js file, Visual Studio Code says 'Cannot find runtime 'node' on PATH. Is 'node' installed?
And the answer to this question is 'yes', because it can be found in my 'usr/local/bin' folder. And when I execute the commando 'echo $PATH' in my bash terminal, then I see this path is included (among others):
echo $PATH
/opt/local/bin:/opt/local/sbin:/Users/{myName}/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Have also done some google searches on the issue but haven't been able to find a sound solution.
Can you please help?
Hans
For background info: I have installed Visual Studio Code via Anaconda and I'm using a Mac on 10.13.6 (MacOS Sierra).

I rather hoped there would be an answer better than the one I am about to give. For me over on Ubuntu 19.04, going through the install process for node fixed the issue; in my case, the PATH variable on my system was correct, and everything in ./.vscode/launch.json was correct. Defeated, I decided to reinstall node, and suddenly debugging worked despite the PATH being exactly the same afterwards. Never thought I would be debugging my debugger!

Related

Changing CAPACITOR_ANDROID_STUDIO_PATH in Arch Linux

I'm trying to set up my development environment for CapacitorJS on Arch Linux.
I followed the documentation and added
CAPACITOR_ANDROID_STUDIO_PATH=/usr/bin/android-studio
to my systems environment variables (not the project) but I'm still getting the same error
[error] Unable to launch Android Studio. Is it installed?
Attempted to open Android Studio at:
/usr/local/android-studio/bin/studio.sh
You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH
environment variable.
Even though It's never pointed to /usr/local/android-studio/bin/studio.sh
I ran whereis android-studio and got android-studio: /usr/bin/android-studio, so I thought that would be the correct path, but every time I run npx cap open android it says it's trying it launch from the same path and never changes
It depends how you've installed it, for example Toolbox installs it inside the user's home directory.
nano ~/.bashrc
export CAPACITOR_ANDROID_STUDIO_PATH=~/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/202.7486908/bin/studio.sh
locate studio.sh might be able to find it, too.

In the linked question, what does the op talk about regarding installing node.js in the working directory?

I am a complete newbie to all this.
I tried to install node.js 4 times and then again uninstalled it every time trying different things, thinking one of them would work.
The link to the question is-Cannot find runtime 'node' on PATH - Visual Studio Code and Node.js
After I typed $node --version in powershell terminal in VSCode (after installing node.js in C drive, defaulting to all recommended options in the setup) I get an error. I have uploaded the image of the error.
the error
Please tell me how to get node.js working with VSCode.
To get the version of Node, just type node --version in the terminal without the "$".

vscode crashes on Arch linux when opening file/folder

Installation vscode
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
It seems like the official Microsoft build should be obtained via the snap store:
sudo snap install code --classic
And the program looks normal. I can install plug-ins, create a new file et cetera.
Problem
However, I cannot open any files or projects. Doing so results in vscode crashing. I read that code --disable-gpu could solve this problem, but doesn't do so for me.
Any ideas
what may cause this crash?
or how to get the pacman vscode working?
Logs
$ code --verbose
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
(code:33833): GdkPixbuf-WARNING **: 22:59:19.817: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
[33863:1104/225919.911481:ERROR:appcenter_api.cc(52)] expecting appcenter url prefix
[main 2020-11-04T21:59:19.960Z] Sending env to running instance...
[main 2020-11-04T21:59:20.041Z] Sent env to running instance. Terminating...
[main 2020-11-04T21:59:20.041Z] Lifecycle#kill()
where the recommended gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache results in bash: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache: No such file or directory
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
I had the same issue trying to get the debugger to work and I spent hours on finding the reason for this. What I found out is that the debugger only works with officially signed Microsoft binaries of VSCode. So you have to make a distinction here:
The package code contains the open source version of visual studio code, a build wich anyone can make using the provided sources by Microsoft. The program which you get here is therefore not signed by MS!
The package visual-studio-code-bin provided by the AUR contains a officially signed version by MS. If you use this package, the debugger works as expected.
I do not know wether snap - which I personally never used at all - provides this kind of package, so I can not tell anything about that, but using the said package from the user repository solved the problem for me reliably.
Try this one (which I installed just yesterday under the recent manjaro distribution and it worked fine) and see if this solves your problem with opening files and folders.

Odoo Mac OSX installation get error "Could not execute command lessc" in PyCharm Community Edition

I installed Odoo 9 on Mac OSX using Homebrew virtual environment.
I installed npm, less and less-plugin-clean-css.
Finally if I launch Odoo from the Mac Terminal, using the appropriate parameters, everything goes well and I can enter my odoo with localhost:8069.
I then setup PyCharm Community Edition for odoo development, but when I run odoo from within PyCharm I get the error:
"Could not execute command lessc"
and obviously the web layout is totally wrong.
I saw here NodeJS plugin in IntelliJ Community Edition does not work that you cannot use NodeJS plugin with PyCharm CE.
My question then is: "How to enable PyCharm CE to use less and get rid of the error?".
If you are in Pycharm in getting error Could not execute command lessc and you have installed less which you can check by entering lessc command in terminal
Fix:
If you are using virtualenv then activate virtualenv from terminal and restart the server again from terminal, this time it won't give any error.
If you are not using virutalenv then you can just run from terminal server without any problems
I'm not sure why this problem is specific to PyCharm.
I had the same issue from PyCharm Professional, but I solve this issue with this way
When i finish installing the PyCharm pro ,then i set the environment variables in the 'run/debug configuraition'
(/usr/loca/bin)
which value(path) i found is using command "which lessc" in the terminal
Then I think the PyCharm can find lessc, and finnally I get rid of this nightmare
`Could not execute command 'lessc'
For me, updating the node was the solution. It was version 0.10.33. Now it's 6.1.12.
Check out this answer. You must uninstall node and reinstall it in a certain order:
https://stackoverflow.com/a/36395799?noredirect=1
At least that is what worked for me.

NDK Build not working

I'm building an android application that requires android ndk.
When i try to execute the command ndk-build.cmd, I get the following error:
"unable to find the specified path"
I've set the path variable to the path where ndk is located, but it still doesn't work...anyone knows how to solve this issue?
The binaries you need to add to the path are in the NDK itself. I think I had the same problem as you which I solved by adding {NDK install dir}/prebuilt/darwin-x86/bin to my path.
I've written a blog post about my experiences of installing ADT/NDK, this solution appears about half way through.
Try to use linux terminal or use cygwin
Or check out this link

Resources