Terminal not working in WebStorm 11.0.4 in Mac - node.js

I have already installed Node.js and I am able to run my existing project in Visual Studio or Sublime Text and terminal in Visual Studio is working perfectly fine.
But when I am trying to run the same project in WebStorm then terminal is not recognizing node, npm n all.
May be some setting is missing in WebStorm. Need help to resolve the same.

In WebStorm | Preferences for macOS, and click Node.js and NPM under Languages & Frameworks
The term local Node.js interpreter denotes a Node.js installation on your computer. You must write your local path for Node.js

Related

Visual Studio Installer is not installing node.js

In Visual Studio Installer, I selected the Node.js development option. It runs successfully. But, if I try to run cmd node -v. It tells me node does not exist.
I tried a few other things including uninstalling and reinstalling the Node.js development option in VS Installer. Plus installing the latest version of node from the website.
However, when I try to run the pre-packed Angular solution that comes with VS 2017 I have issues. The solution will not even start.
The best I have been able to do is install Node 6.10.3. Once I do that, the web site comes up. But, I get a JavaScript error in the vendor.js file. I am able to continue but I get this error when I try navigate to another menu item. Plus the Hot Module Replacement does not seem to be working. (It does not automatically recompile my TypeScript file if I made a change).
I think the key is getting the Node.js development option installed correctly since I am able to run the pre-packed Angular solution on another PC and the Hot Module Replacement works fine.
Please let me know if anyone has any ideas on how to resolve.
I had a similar, if not the same, issue. Check the Visual Studio installation directory (2017 Professional in this case) for Node:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\NodeJs
If the executable is there, add the directory to your PATH.

Creating an Electron app using Visual Studio (not VSCode) w/ Node.js tools

I'm trying to use Visual Studio (not VSCode) to create a simple Electron app. I'm doing so via the Node.js tools for Visual Studio (v1.1) extension. I'm using the basic quick start app which works fine if I launch via npm start, but if I launch via Visual Studio, I get the following error on start up:
'Cannot find module 'electron' on the first line:
const electron = require('electron');
Can I tell Visual Studio to launch the Electron app first before starting it's node.js debugger? Has anyone else gotten this set up to work at all?
This is possible:
Create a blank Node.js JavaScript console app in Visual Studio. You need a recent version of node installed I think: I have 12.18.3. I'm using VS 2019 Community.
Add a dependencies section to the package.json that's created and reference electron. I referenced 11.0.1 as below:
"dependencies": { "electron": "11.0.1" },
This puts an entry in Solution Explorer under npm, so to actually
install it you can right-click/install npm package (or fire up a
command prompt and do npm install).
Copy the code from the electron-quick-start on GitHub: create index.html AND preload.js files in your Visual Studio project, and paste the code from GitHub into them. Also paste the quick start main.js contents into app.js. There's no need to rename it.
Go to properties of the console app project file. Where it says 'Node exe path:' put the path to electron.exe that was installed, which is in subfolder node_modules\electron\dist\electron.exe.
Put a breakpoint on the first line of createWindow in your app.js.
Start in debug. It should break at the breakpoint and if you continue it will show the basic electron app. This is an Electron window with a message in it: e.g. 'Hello World! We are using Node.js 12.18.3, Chromium 87.0.4280.60, and Electron 11.0.1.'
This is all well and good, but how useful it is depends on what you really want Visual Studio to do for you. It will only break on the main thread, although you can debug the renderer threads using the Chrome dev tools as usual. I find the node tools apps a little limiting. Maybe one of the other project types would be better.
This answer was updated November 2020, and previous answers removed. Note that as usual in npm world things do tend to break over time: please make a comment if things aren't working for you.

Intellij 14 gradle fails to run bower command

I am just starting to play with the JHipster framework / code generator using intellij 14.1.5 on OSX Yosemite. I have a simple app with a couple of domain objects which I have imported into Intellij as a gradle project. When I attempt to run the app via the gradle build "run" task, the build fails on the bower command. I can successfully run this gradle task from the osx terminal app AND from withing Intellij's terminal window. It fails when I invoke the run task from the from the gradle tasks pane or if I run it from the "run configurations" drop down in the toolbar. It feels like it fails when Intellij invokes gradle, but succeeds when gradlew is invoked in a terminal. I'm not sure why there would be a difference in these environments / invocations.
I have installed npm/gulp/bower/yoeman via nvm/node and am up on current versions (installed today). Node is at 4.1.1.
Posting this answer because no one has posted one yet. I have followed the recommendation of this other post. It fixes the Intellij app launcher on the mac to recognize the path for node commands. The original technique is described in apple.stackexchange.com. I am using this technique with the latest Intellij Idea 2016.1.3 and Intellij invoked gradle runs bower / npm just fine.
Just update gradle version.
Open gradle/wrapper/gradle-wrapper.properties
and change version like
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip

VS2015 Cordova apps BLDErr_Build_NodeMissing

I am trying to develop a cordova application using vs2015.I am new to vs2015 corodova application.I have been using the node.js and ionic cli to develop hybrid application.My system is Windows 8.1x64 bit.
After creating a sample vs2015 cordova application while running ,I got an error
"Severity Code Description Project
File Line
Error BLDErr_Build_NodeMissing
Path to Node.js executable could not be determined. Please check that Node.js has been installed".
I have set the path variable for node js and npm in enviorment variable section.
Please help and
Thanks in advance
Ajeesh13
I had the same issue once I had installed Node 4.1 to a different path (other than default C:\ ). Reinstalling Node to default path and clearing the Cordova Cache fixed it for me. Hope this helps.
Running VS'15 in Administrative mode (Right click -> Shift + Right Click on Vs 2015 -> Run as Administrator) ,solved the problem for me.
Re-installing node.js alone didn't solve the problem for me.

Visual Studio debugger not runnig existing node project

I have created a node project using the express-generator and have not added any additional code to it. If i run it from the npm command prompt with npm start, it is working on localhost:3000.
If i use the template from existing nodejs code in Visual Studio, hitting the debug or run button never works. It pops the node.exe console and closes it after one sec. "Debugger listening on port 5858".
Creating an express app from Visual Studio works as expected.
What do i have to configure to get it working the same way as a default project created with VS?
Update:
Seems that even if I take the files from the working project and use them to create another "From Existing Node.js code" the debug/run command fails. So i guess it has something to do with the project file, but i checked them and they seem to be the same. What am i missing?
After much digging i ran WinMerge on both projects and noticed that inside the project file StartupFile was set to app.js instead of bin/www.
To change the StartupFile, right-click on the JS app and select "Properties". Under "General", you will see "Script (startup file)", which is where you make the change.
Home this helps someone else trying to use Visual Studio as an IDE for node.js.

Resources