简体   繁体   English

像桌面应用程序一样运行Node-Webkit

[英]Run Node-Webkit like a desktop app

I know this may sound really stupid, but I'm a web developer. 我知道这听起来确实很愚蠢,但是我是一名Web开发人员。 I save a file to the server, and never compile the code to work, I just reload my browser and my new scripts are running. 我将文件保存到服务器,并且从不编译代码以使其正常工作,我只是重新加载了浏览器,并且新脚本正在运行。 However, I want to get more into javascript on server-side such as node and webkit. 但是,我想在服务器端使用更多的JavaScript,例如node和webkit。

https://github.com/rogerwang/node-webkit https://github.com/rogerwang/node-webkit

The goal is to edit my code, save it, and test out the results. 目的是编辑,保存代码并测试结果。

Where do I learn this or start? 我在哪里学习或开始学习? People all over the internet point to composer stuff, and I understand JSON, but I only understand how code runs on the web. 互联网上的人们都在指点作曲,而且我了解JSON,但我只了解代码如何在网络上运行。

I don't know how you use desktop compiling to run a program, such as saving my javascript and allowing node to compile and show me the results. 我不知道您如何使用桌面编译来运行程序,例如保存我的JavaScript并允许节点编译并向我显示结果。 No one shares how that works. 没有人分享它是如何工作的。 I'm a simple person, I want to see my project files, and how they are executed, but for some reason, I try to install this stuff and never get very far at all, I try using windows cmd, always pops up some errors, if someone could please point me in the right direction that would be really helpful. 我是一个简单的人,我想查看我的项目文件以及它们的执行方式,但是由于某种原因,我尝试安装此文件,但从未尝试过,我尝试使用Windows cmd,总是弹出一些错误,如果有人可以指出正确的方向,那将非常有帮助。

For instance, #1 how do I install node-webkit, (and if thats only thing I need to install) and #2 how do I take my project files and execute them into an actually running program using node-webkit 例如,#1如何安装node-webkit,(如果那只是我需要安装的东西)和#2如何获取我的项目文件,并使用node-webkit将它们执行到实际运行的程序中

If you have no prior experience working on the command line. 如果您以前没有使用命令行的经验。 You might want to first dabble a bit with pure node.js (meaning not doing anything gui related like node-webkit). 您可能首先想使用纯node.js(这意味着不做与gui相关的任何事情,例如node-webkit)。

Your aim should be to understand node.js and the package manager npm and how to use your command line environment (like cmd on windows) before moving on. 您的目标应该是在继续之前了解node.js和程序包管理器npm以及如何使用命令行环境(例如Windows上的cmd)。

Here are some tutorials targeted on Windows users: 以下是针对Windows用户的一些教程:

http://dailyjs.com/2012/05/03/windows-and-node-1/ http://dailyjs.com/2012/05/03/windows-and-node-1/

https://www.planbox.com/blog/development/coding/getting-started-with-nodejs-on-windows.html https://www.planbox.com/blog/development/coding/getting-started-with-nodejs-on-windows.html

EDIT (one more link): http://blog.gvm-it.eu/post/20404719601/getting-started-with-node-js-on-windows 编辑(另一个链接): http : //blog.gvm-it.eu/post/20404719601/getting-started-with-node-js-on-windows

Please note that pure simple node.js does not have any DOM-tree as you are used to from developing in the browser. 请注意,纯净的简单node.js没有任何DOM树,就像您习惯在浏览器中进行开发一样。

After you accomplish basic tasks in node js, like opening and reading a text file, printing text on the command line and installing modules, you might have more luck with https://github.com/rogerwang/node-webkit . 在完成节点js中的基本任务(例如打开和读取文本文件,在命令行上打印文本并安装模块)之后, https://github.com/rogerwang/node-webkit可能会让您更加幸运。

Node is an interpreter. Node是解释器。

You simply run node yourfile.js and it runs your code. 您只需运行node yourfile.js ,它就会运行您的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM