nodejs development environment configuration and use_node.js
Let’s talk about nodejs first. Some people think it is a language, but it is not. It is a platform, a js running platform built on Google’s V8 engine. It parses js and provides some of its own APIs. User calls. Judging from the current situation, this development is pretty good. There will be many front-end and back-end engineers joining tomorrow. Even some experts are paying attention and even writing blogs. Last night I saw an article written by a foreign website. I have developed nearly 90 nodejs web plug-ins. This is really awesome! So what are the most direct benefits for us to learn from China Dongdong: Since the front-end personnel are familiar with js, they can basically learn Linux and get started. It is a little more troublesome for the back-end engineers, because some back-end engineers are not very good at it. If you are familiar with js, there may be many obstacles in using it. Here I suggest you learn basic js. After talking about this, I think what everyone is concerned about is the salary issue. So far, basically nodejs engineers with more than one year have been offered in Guangzhou. It’s over 7K. A former colleague mentioned this about his company’s recruitment situation, and I found out that this thing is almost as good as hadoop! Enough nonsense, let’s talk about this topic: environment configuration (since I developed under windows 8.1, I will only talk about windows here).
Install nodejs
First go to the nodejs official website http://www.nodejs.org/download/ to download the corresponding version. Mine is 64-bit. Install directly after downloading. Since the current version has reached v0.10.33, node and npm have been installed together, and even the environment variables have been set. After installation, you can see the following in the corresponding folder
After installation, you can use Shift to right-click in the currently installed folder to open cmd and enter the following to view the installed version. Mine is 0.10.32.
node-v
2. Global folder settings
As for node_cache and node_global, beginners should not need to set them, because they will be set in the current user directory, but sometimes they will be set for convenience. The setting commands provided here are as follows:
npmconfigls//列出prefix配置<br>npmconfigsetcache'D:\ProgramFiles\nodejs\node_cache'//设置全局缓存文件夹<br>npmconfigsetcache'node_global'//设置全局模块文件夹
3. Install the module
Now we have installed node and npm. As the name suggests, npm is the package manager of node. It is managed through commands. Let’s try it now:
Let’s install express, a web framework. The parameter -g represents installation in the global folder, if not, it represents the current folder
npminstallexpress-g//express还可以带上@版本号
Let’s check in the folder we just set to see if there are any more files. Here we use the command to check the version number of express that we just installed
express-V
If there is an output version, it means the installation is successful!
If we want to uninstall this plug-in, we can use the following command
npmuninstallexpress
After uninstalling it like this, we can install it back to express, but with the version number 3.2.2 (because this is the version I am most familiar with). Is this possible?
4. Use express to install
Now we use the command to create a web site, as follows:
expressTest
This will output some prompts. You can jump directly into the Test folder and run the site using the command:
nodeapp.js
Did you see the prompt? The port 3000 indicates that the startup was successful, but our browser reported an error when browsing. What is the prompt?
500 Error: Cannot find module 'jade'
Then there is an error message, so let’s install this module now. Here, there is a package.json file in this folder. This file describes some site information. We can use nodepad to open it. Take a look:
This shows that two libraries are needed, one is express and the other is jade, so let’s install it now. If you install many modules, you will need to execute many commands. Here is a relatively simple command, which will check the current Install the dependent libraries of package.json:
npminstall
After installing this module, we also need to modify the doctype 5 in the first line of the layout.jade file under views to doctype html. Then re-execute node app.js and our website can run normally.
5. Install supervisor plug-in
刚才我们可能都发现了,如果出了问题,nodejs自动停止了服务,这样很不利于调试啊,那我们有一个插件可以解决。这个插件是管理nodejs的进程,包括调试那些都非常好用。使用如下命令安装全局的模块:
npminstallsupervisor-g
这样我们就不用node命令来启动服务,直接使用supervisor app.js来就可以了。
六、 使用webStorm IDE
刚 才我们编辑js文件是使用nodepad来的,但这个不是很好,有好的编辑器吗,答案是有的,一个大名顶顶的webStorm,网上很多那个版本的下载, 大家懂得了,这里也提供一份网友给的链接http://yunpan.cn/cAcf6hVxnIbCt 提取码 246f,下载完直接安装,安装完覆盖一个exe文件就可以了,屌丝这样简单吧!
第一次运行是会打开一个文件夹,其实就是项目的文件夹。
下面来说下调试的问题,包括我也搞了好久网上也找了好久,最后在波哥说下才搞定,这个其实很难简单的,直接看图了:
如何在程序里打断点就可以进行调试了,很方便。
以上就是个人对于nodejs开发环境配置与使用的经验的全部记录了,后续再继续分享一些nodejs的详细应用。

The main difference between Python and JavaScript is the type system and application scenarios. 1. Python uses dynamic types, suitable for scientific computing and data analysis. 2. JavaScript adopts weak types and is widely used in front-end and full-stack development. The two have their own advantages in asynchronous programming and performance optimization, and should be decided according to project requirements when choosing.

Whether to choose Python or JavaScript depends on the project type: 1) Choose Python for data science and automation tasks; 2) Choose JavaScript for front-end and full-stack development. Python is favored for its powerful library in data processing and automation, while JavaScript is indispensable for its advantages in web interaction and full-stack development.

Python and JavaScript each have their own advantages, and the choice depends on project needs and personal preferences. 1. Python is easy to learn, with concise syntax, suitable for data science and back-end development, but has a slow execution speed. 2. JavaScript is everywhere in front-end development and has strong asynchronous programming capabilities. Node.js makes it suitable for full-stack development, but the syntax may be complex and error-prone.

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
