Please specify node.js interpreter correctly WebStorm error - node.js

I'm trying to simply create a React Native project via Webstorm but I get this error upon trying to do so which's resulting in myself not being able to start a project.
Whenever I do choose a Node interpreter it gives me an error that says Unspecified react-native cli package at the same spot that says Please specify node.js interpreter correctly.
I've been starting React Native projects like this since the beginning but this time I get this error out of no where, I don't know where it came from. How can I fix this?

Opens up your terminal, and use the which command to find our your NodeJS interpreter
$ which node
/Users/felixfong/.nvm/versions/node/v8.0.0/bin/node
And copy that result, and update your Node interpreter field inside yoru WebStorm
Hopes this help

Related

Installed Node.js and Sublime Text But Keep Getting Errors

I'm a beginner at trying to learn web development. I currently downloaded node from the nodejs.org website and also downloaded Sublime Text 3 from the website as well.
My code for sublime is as follows:
$ node
console.log("Who's you're daddy?");
When I try to run it on node.js I get an error that says:
"Syntax Error, Unexpected Identifier."
This is literally step one and I'm already messing up. How have I set this up wrong?
From What you are trying to do seems like you want to print "Some String" in the console using nodejs.
In nodejs you can create a javascript logic first and then you can execute that logic using node.
Create a file somefile.js
Write following code in the file:
console.log('Who's your daddy?');
In terminal and execute:
node /location/of/the/file/somefile.js
It should print 'Who's your daddy?' in the console.
To learn more about nodejs and to get started you can refer to How do I get started with Node.js

Node.JS, CLI with VSCode not finding path to NPM modules, launch.json

I want to write a command line program to use via node.js and CLI module. VSCode is not finding .require('cli') so no intellisense.
Then when I launch for debug it isn't looking in the right place, it's looking at APP\npm_modules\cli.js when it is APP\npm_modules\cli\cli.js.
I do have cli installed both locally and globally and I have a NODE_PATH environment pointing accordingly.
The same code works correctly when run at the command line, so it's a VSCode issue. Perhaps, there is a different editor that offers debugging that I should consider?
My mistake. Turns out that I had enabled the debugger to break on all exceptions and as .require resolves, it is looking in several places, eventually the module is found, but there are a number of caught exceptions along the way. I was stuck at looking at the first exception.

Issue with Node-based Cordova Hook

I'm playing around with the Cordova hooks capabilities and I'm trying to test using a node application as a hook. In this article: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ it references running node applications, so I know it's possible.
I've created a simple node application that I'm using to test the before prepare and after prepare process:
#! /usr/bin/env node
console.log("this is a node module");
When I run my prepare, I get the following error:
C:\Users\jwargo\dev\lunchmenu>cordova prepare
The system cannot find the path specified.
Hook failed with error code 1: C:\Users\jwargo\dev\lunchmenu\hooks\before_prepare\test.js
I can't find any information anywhere about what an error code of 1 means here.
I've tested the node code and it runs fine with "node test.js" and when I execute test.js from the command line Windows simply launches my default editor.
So, can anyone tell me what I'm doing wrong or what I need to do to be able to execute a node application as a hook with the Cordova CLI?
Figured it out with some help from the Cordova dev team. The space in my shebang was causing the problem. I removed it and the problem went away.

Basic Node.js setup on Windows

I'm trying to get node.js to run a sample script I've created. I'm using Windows. mysamplescript.js is in the same folder as the node.js executable. When I type in
node mysamplescript.js
I get ... returned on the next line. The docs for node aren't exactly stellar. Am I missing something?

getting node.js working

So I'm following:
http://giantflyingsaucer.com/blog/?p=894
and installing node.js.
I got up to the part with sudo make install.
It works, then it says to create a js file.
What I don't understand is where I put the sayhello.js?
Node.js looks at least for the programmer more like a interpreter. Thus, you can place your sayhello.js whereever you want and run it by executing node sayhello.js.
However, you might consider using external modules. Then you must check that they are set by full path or the relative path can be resolved from the location you execute node in.

Resources