美文网首页我爱编程
Node.js 入门(一)—— 安装和使用

Node.js 入门(一)—— 安装和使用

作者: 154396b61865 | 来源:发表于2018-01-19 21:47 被阅读0次

一、安装(CentOS)
curl -sL https://rpm.nodesource.com/setup_7.x | bash -
yum install -y nodejs
yum install -y gcc-c++ make

安装完成之后,为了加速下载过程,建议换源。
nano ~/.npmrc 写入 registry =https://registry.npm.taobao.org

二、基本操作
1、查看版本**
node -v
2、运行 js
vim helloworld.js 写入 console.log("Hello World");
node helloworld.js
3、初始化工程
mkdir expressTest
cd expressTest
npm init
4、安装依赖包
npm install express --save
查看安装的包:ls node_modules 或者 npm list

三、常用框架&包

四、其他工具

相关文章

网友评论

    本文标题:Node.js 入门(一)—— 安装和使用

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