美文网首页
Node.js总结

Node.js总结

作者: 慕名66 | 来源:发表于2018-10-12 09:39 被阅读0次

1.NodeJs官网地址

2.检查版本:node -v(node --version)

编写node程序

        ①var http = require('http'); //引行请求(require)Node.js 自带的 http 模块

        ②http.createServer(function (request, response) { 

                // 发送 HTTP 头部 // HTTP 状态值: 200 : OK 

                // 内容类型: text/plain  

                response.writeHead(200, {'Content-Type': 'text/plain'}); 

                // 发送响应数据 "Hello World"    

                response.end('Hello World\n'); 

            }).listen(8888);  

3.window下npm升级:npm install npm -g

 4.npm 安装 Node.js 模块语法格式: npm install 模块名称

    安装模块时报错:npm err! Error: connect ECONNREFUSED 127.0.0.1:8087

    解决办法,设置代理为null:  npm config set proxy null

    npm 的包安装分为本地安装(local)、全局安装(global)两种,从敲的命令行来看,差别只是有没有-g而已:

        npm install express # 本地安装

        npm install express -g # 全局安装 

5.卸载模块: npm uninstall 模块名称

6.查看安装模块:npm ls

7.更新模块:  npm update 模块名称

相关文章

  • 2019-12-19

    # Node.js 第1天 ## 上午总结 - Node.js 是什么 + JavaScript 运行时 + ...

  • node.js总结

    总结一: [node.js总结](http://www.cnblogs.com/Darren_code/archi...

  • 深入node.js内部原理

    Node.js 探秘:初识单线程的 Node.js 第二遍总结 Node.js通过libuv来处理与操作系统的交互...

  • 一个完整的Node.js RESTful API

    前言 这篇文章算是对Building APIs with Node.js这本书的一个总结。用Node.js写接口对...

  • Node七天笔记汇总

    Node.js 第1天 上午总结 Node.js 是什么JavaScript 运行时既不是语言,也不是框架,它是一...

  • Atitit运维开发语言总结

    Atitit运维开发语言总结 目录 1. Node.js优缺点 1 1.1. Node.js缺点 运维环境 1 2...

  • Node.js总结

    1.NodeJs官网地址 2.检查版本:node -v(node --version) 编写node程序 ①...

  • Node.js是什么

    什么是Node.js呢?一句话总结,Node.js是基于chrome V8 Javascript引擎基础上的一个库...

  • Node.js初学资料

    title: Node.js初学资料总结date: 2019-03-25 11:19:47categories: ...

  • Node.js的安装及简单使用

    今天要搭建node.js,所以自己就总结了一下。该文章不是原创。 什么是node.js? 每一种解析器都是一个运行...

网友评论

      本文标题:Node.js总结

      本文链接:https://www.haomeiwen.com/subject/fnjwaftx.html