Using Node.js on my fish / cygwin shell - javascript

I am following a course and on the learning process so apologies if any of this is simple!
I have installed the fish shell on cygwin through the cygwin installer as an option. I also have node (and npm) installed.
However, when typing 'node' in the shell, it just hangs and does not show the next line to use node instead?
Any help to get this working would be really appreciated!
Please see the image of my terminal response here

node run by itself drops you into an interpreter.
Does ctrl c print this message?
(To exit, press ^C again or type .exit)
What if you do this:
node -e 'console.log("foo")'
I get:
node -e 'console.log("foo")'
foo
What about if you just start typing
node
[press enter]
type in:
console.log('foo')
[press enter]

Related

Error in protobuf | npm ERR! code ELIFECYCLE :: while setting Sawtooth JavaScript Transaction Processor in Ubuntu 16.04

Currently working on sawtooth example
Things I have done :
Installed latest Node(8.11.3)& npm version.
Started javascript
essential thing using docker-compose up.
Things giving error:
Want to setup Javascript transaction processor so moved to dir jsprocessor.
Trying to install all node modules using $ npm i, but giving error shown in image. I think it is relate to node js.
Reinstalled Node & NPM, Externally installed npm module that producing error but no effect.
What am I doing wrong?
I would follow the directions at
https://github.com/askmish/sawtooth-simplewallet
Which seems different from what you ran.
Build and start the Docker containers:
docker-compose -f simplewallet-build-client-js.yaml up
Open bash shell in simplewallet-client-js container:
docker exec -it simplewallet-client-js bash
Create user accounts for jack and jill:
sawtooth keygen jack && sawtooth keygen jill
Open two new browser tabs and go to http://localhost:3000 on each tab.
Login in one tab as jack and in other as jill Start with an initial deposit for each user - jack and jill via the Deposit tab in the UI homepage

node.js can't check version after installation on windows 10

I installed node.js version 4.4.1 on windows 10 and I tried to code with tutorial from internet. The first thing recommended was to write "$ node -v", but after that i'm getting following error:
You're already in the Node REPL, not in Windows' cmd (see the Node icon in the title bar?). You can directly write JS in that.
To get the version, run node -v on Windows' cmd.
you cant check node version inside node REPL to check the node version you need to exit Node REPL, ctrl+c x2 then type node -v or lunch cmd and type node -v

is it possible to debug node repl

Is is it possible debug NODE REPL. node cmd bring the repl prompt >. within the prompt is it possible to start the debugger. say for eg
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
Yes
New way: node 8 >=
node --debug is marked for deprecation.
[DEP0062] DeprecationWarning: node --debug and node --debug-brk are invalid. Please use node --inspect or node --inspect-brk instead.
node --inspect is the way moving forward.
Old way
Start the repl with node --debug. Then you can can use node-inspector (an npm package) from a separate terminal, and debug in your browser with the chrome developer tools by opening http://localhost:8080/debug?port=5858 in chrome. You can, for example, set a breakpoint in the repl.js file in the complete function, and if you go to the node repl and hit TAB, it will trigger the breakpoint and you can debug it.
If you want the coffee-script repl, it's coffee --nodejs --debug.

where do I enter my node commands and why?

Node n00b here. I just installed node on my windows desktop and I'm wondering where I should enter my node commands and why... I have three options (see below). Oh, and if one of these (i.e. node.exe) is not intended for entering node commands, what is it for?
I have looked at the nodejs.org docs and I don't see a clear overview/explanation of what each of these are for and why it's recommended to use one over the other.
Thanks for any insight.
================================================
1) Windows Command Line:
2) Node.js command prompt:
3) Node exe
#1 This is simply window's cmd, you can type node --help there to get a general overview of what you can do with node
#2 Also cmd but with some extra configuration, when you view the properties you'll see it's; C:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs\nodevars.bat" Which basically means it runs cmd with a .bat script, that sets some environment variables, changes the title and prints some welcome message.
#3 This is NodeJS' REPL which evaluates JavaScript within NodeJS' context. ( This is the same as running node from cmd )
Usually you don't enter your code directly, but put it in a file instead. Create this file with the name hello.js:
console.log("Hello World!");
Switch to the directory of your file:
cd C:\Users\yourname\yourdirectory
Then run it with the node command:
node hello.js
And you should get the following output:
Hello World!

Running Xcode from terminal cant open javascript script (Error: Instruments cannot open files in the “TextWrangler text document” format.")

I'm in the process of setting up our CI environment for one of our iOS projects. So far I have got Jenkins building and packaging the app from the command line. I have written a automation test in Instruments (Automation) and I want to fire this from the command line/terminal. I have followed the posts on here describing the way to do this (Start Instruments from the command line & Can the UI Automation instrument be run from the command line?) so I know this is possible.
Unfortunately, when I try this I get an alert with:
"The document “AutomatedTests.js” could not be opened. Instruments cannot open files in the “TextWrangler text document” format."
Here is the command i'm using:
/Applications/Xcode4.6.3.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments \
-t /Applications/Xcode4.6.3.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -a "/Users/[CI USERNAME]/workspace/[IOS APP FOLDER]/IOS/build/Debug-iphoneos/[IOS APP NAME].app" \
-e UIASCRIPT /Users/[CI USERNAME]/workspace/[IOS APP FOLDER]/IOS/[FOLDER CONTAINING TEST FILE]/AutomatedTests.js
https://github.com/bendyworks/bwoken
Try this instead of using xcode directly, might save you some time

Categories