How do I get started with Node.js?

This question already has an answer here: How do I get started with Node.js [closed] 3 answers 我认为你的命令行应该是'node example.js'

我如何开始使用Node.js?

这个问题在这里已经有了答案: 我如何开始使用Node.js [已关闭] 3个答案 我认为你的命令行应该是'node example.js'

Restoring console.log()

For some reason, the prototype framework (or another JavaScript code) that is shipped with Magento is replacing standard console functions, so I can't debug anything. Writing down in JavaScript console console I get the following output: > console Object assert: function () {} count: function () {} debug: function () {} dir: function () {} dirxml: function () {} error: function () {} gro

恢复console.log()

出于某种原因,Magento附带的原型框架(或其他JavaScript代码)正在取代标准控制台功能,因此我无法调试任何内容。 在JavaScript控制台console写下我得到以下输出: > console Object assert: function () {} count: function () {} debug: function () {} dir: function () {} dirxml: function () {} error: function () {} group: function () {} groupEnd: function () {} info: function () {} log: function () {} pro

How to call a JavaScript function on a web page rendered by Electron?

I'm trying to write a wrapper for Twitter using Electron (formerly Atom Shell). My main.js file (it looks almost identical to the "Hello World" example, I just changed it in one place): var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window. // Report crashes to our server. requi

如何在Electron呈现的网页上调用JavaScript函数?

我正在尝试使用Electron(原名Atom Shell)为Twitter编写包装器。 我的main.js文件(它看起来与“Hello World”示例几乎相同,我只是在一个地方更改了它): var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window. // Report crashes to our server. require('crash-reporter').start(); // Keep a global referen

Cannot understand node.js

From someone with few experience in JS, what do you recommend for learning Node.js? I read a lot in the forum about event driven, non-blocking , async, callbacks, etc but I don't know what's that! Where can I learn the basics in order to understand all that terms and in the future, node.js? Thanks! The concepts you mention (event-driven, non-blocking, async, callbacks) aren't

无法理解node.js

从JS中很少有经验的人,你推荐学习Node.js的什么? 我在论坛上阅读了很多关于事件驱动,非阻塞,异步,回调等的内容,但我不知道那是什么! 我在哪里可以学习基础知识以了解所有术语以及将来的node.js? 谢谢! 你提到的概念(事件驱动的,非阻塞的,异步的,回调)并不特定于JavaScript,并且在更一般的上下文中理解它们是有价值的。 他们都围绕着优雅地处理我们无法控制的资源。 想象一下,等待来自TCP连接的数据,

how can I use console.log to debug a test?

I am using the javascript test-runner "Mocha". I have a test that is failing, so I would to debug it using console.log . But when the tests are run, there is no output (only the test results from Mocha). It seems like Mocha has captured and suppressed my console.log output! How can I get Mocha to show my output? (at for tests that fail)? EDIT: Huge apologies! — console.log

我如何使用console.log来调试测试?

我正在使用JavaScript测试运行“Mocha”。 我有一个失败的测试,所以我会使用console.log进行调试。 但是当测试运行时,没有输出(仅来自Mocha的测试结果)。 摩卡似乎已经捕获并压制了我的console.log输出! 我怎样才能让摩卡显示我的输出? (在测试失败)? 编辑: 巨大的歉意! - console.log在测试过程中不起作用! 我一定会期待它压制输出,而我没有正确地检查自己的代码。 感谢您的回应。 所以...说的是...

How can I debug Node.js

This question already has an answer here: How do I debug Node.js applications? 31 answers I googled "node phpstorm debug" and found this. Hope that helps! I'm a huge fan of the node-inspector for these purposes-- let's you use the Chrome dev tools for debugging Node applications. (From this SO.) I've heard good things about vscode. Here's more info https://c

我如何调试Node.js

这个问题在这里已经有了答案: 我如何调试Node.js应用程序? 31个答案 我GOOGLE了“节点phpstorm调试”,并发现这一点。 希望有所帮助! 为了这些目的,我是节点检查员的忠实粉丝 - 让我们使用Chrome开发工具来调试节点应用程序。 (从这个SO。) 我听说过有关vscode的好消息。 这里有更多信息https://code.visualstudio.com/Docs/editor/debugging

How to execute code from Node.js server command line?

This question already has an answer here: How do I debug Node.js applications? 31 answers V8 comes with an extensive debugger which is accessible out-of-process via a simple TCP protocol. Node has a built-in client for this debugger. To use this, start Node with the debug argument; a prompt will appear: Node's debugger client doesn't support the full range of commands, but simpl

如何从Node.js服务器命令行执行代码?

这个问题在这里已经有了答案: 我如何调试Node.js应用程序? 31个答案 V8带有一个广泛的调试器,可以通过简单的TCP协议进行流程外访问。 Node为此调试器提供了一个内置客户端。 要使用它,请使用debug参数启动Node; 会出现一个提示: 节点的调试器客户端不支持全部命令,但可以进行简单的步骤和检查。 通过放置语句调试器; 到脚本的源代码中,您将启用一个断点。 http://nodejs.org/api/debugger.html 是的,这

detecting node.js http.get calls that take long time

A handler that makes multiple http calls to render a page takes a long time to return. I'd like to detect which of the calls take long time to complete. A profiling approach that I've found via googling[1] doesn't work on Mac OSX seems involved displays way too detailed information for my needs I'm using express and Q promises nested several layers deep if it makes any d

检测需要很长时间的node.js http.get调用

使多个http调用呈现页面的处理程序需要很长时间才能返回。 我想检测哪些电话需要很长时间才能完成。 我通过Google搜索找到的剖析方法[1] 在Mac OSX上不起作用 似乎涉及 为我的需求显示方式太详细的信息 如果它有任何区别,我使用express和Q promises嵌套几层 [1] http://blog.nodejs.org/2012/04/25/profiling-node-js/ 使用中间件来跟踪请求并记录它们,如果它们花费太长时间。 一个例子是: app.use(function(

Ticker problems when combining CreateJS + PhoneGap

I am currently developing an HTML5/JavaScript game using the CreateJS suite, and it worked very nicely in a browser. I am now attempting to modify it so it will work as a PhoneGap application. I've managed to iron out all the kinks so far; except the Ticker. Basically, I have an initialize function which populates my LoadQueue, which calls handleComplete when loaded. At the end of the ha

组合CreateJS + PhoneGap时的代码错误

我目前正在使用CreateJS套件开发HTML5 / JavaScript游戏,并且它在浏览器中运行得非常好。 我现在正在尝试修改它,以便它可以作为PhoneGap应用程序工作。 到目前为止,我已经设法解决了所有的问题。 除了代码。 基本上,我有一个初始化函数来填充我的LoadQueue,它在加载时调用handleComplete。 在handleComplete函数的最后,我设置了: createjs.Ticker.addEventListener("tick", this.tick); createjs.Ticker.setFPS(game

nodejs vs node on ubuntu 12.04

I installed nodejs on ubuntu from instructions given here When I write node --version in the terminal I see this : -bash: /usr/sbin/node: No such file or directory I can see node in the /usr/sbin/ directory, though. Writing npm --version shows 1.3.5 Writing nodejs --version shows v0.10.15 Also, I can see node in the /usr/bin/ directory. So, how do I get node working? Also, If I us

nodejs vs Ubuntu 12.04上的节点

我根据这里给出的指令在Ubuntu上安装了nodejs 当我在终端中写入node --version时,我看到: -bash: /usr/sbin/node: No such file or directory 不过,我可以在/usr/sbin/目录中看到节点。 写npm --version显示1.3.5 编写nodejs --version显示v0.10.15 另外,我可以在/usr/bin/目录中看到节点。 那么,我如何让node工作? 另外,如果我使用zsh而不是bash,那么node命令就可以工作。 您需要手动创建符号链接/us