Build and configure NODEJS environment in Linux environment, use Nodejs to write tools and simplify less compilation

Source: Internet
Author: User
Since my server is a purchased cloud server, the entire configuration is connected to SSH

Lnmp

由于云服务器刚使用不久,此前一直是只安装了centos 6.5版本的裸机,因此这次顺道配置了LNMP,整个LNMP环境的安装和LAMP环境的搭建基本一致。附本人参照的配置博客:http://www.cnblogs.com/xiaoit/p/3991037.html,这篇博客只是基础的安装LNMP,并测试Nginx解析php脚本文件,并未对各个环节做详细配置说明,如果想看详细的配置,请自行百度。

node. JS Installation

在Node.js上下载安装包,非源码包,因为安装包是已经被编译过,可以直接使用,源码包安装的话,繁琐坑多。1.在安装之前首先核对自己的系统位数
getconf LONG_BIT

2.在node.js上下载相应版本的安装包(https://nodejs.org/en/download/)

3.通过ftp上传到自己的云服务器上4.解压缩文件 $tar xvJf  ***.tar.xz5.移动解压缩的文件到node     $mv *** node6.因为安装包已经被编译过,因此不需要再安装,直接可以使用,但是为了以后使用的方便,进行环境变量的配置   export PATH=/root/node/bin  (如果不确定自己的文件夹路径,可以使用 find /path -name node进行查询)7.然后 node -v 和npm -v进行测试!

Use node. js to write less


Press the Q key to exit the current operation

4.编写代码,测试less环境
@color: #4D926F;#header{  color: @color;}h2{  color: @color;}
5.输入:lessc /Users/vickay/Desktop/testLess.less /Users/vickay/Desktop/testLess1.css ,可以在桌面生成css文件

6.如果在编译过程中想要将css文件压缩,则输入:lessc -x /Users/vickay/Desktop/testLess.less /Users/vickay/Desktop/testLess.css ,只是比5多了-x参数,在执行过程中,会有以下提示:

7.生成css文件内容的比较

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the NODEJS environment in the Linux environment and configuration, using Nodejs to write tools and simplify less compilation, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.