User Tools

Site Tools


webdesign:html5-and-javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
webdesign:html5-and-javascript [2016/08/30 01:23] – [npm(node package manager for javascript...)] adminwebdesign:html5-and-javascript [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 10: Line 10:
  
 ==== Node.js ==== ==== Node.js ====
-refer: https://nodejs.org/+refer:  
 +  * https://nodejs.org/ 
 +  * tutorials: https://www.w3schools.com/nodejs/default.asp
 Node.js® is a platform built on **Chrome's JavaScript runtime** for easily building fast, scalable network applications. Node.js uses an **event-driven, non-blocking I/O model** that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Node.js® is a platform built on **Chrome's JavaScript runtime** for easily building fast, scalable network applications. Node.js uses an **event-driven, non-blocking I/O model** that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
  
Line 21: Line 23:
 </code>output:<code> </code>output:<code>
 v4.2.6 v4.2.6
 +</code>
 +Install nodejs from source on linux:
 +  - Step1: Get nodejs source<code bash>
 +https://nodejs.org/dist/v8.11.1/node-v8.11.1.tar.gz
 +</code>
 +  - Step2: Install<code bash>
 +tar xzvf node-v* && cd node-v*
 +./configure
 +make
 +make install
 +</code>
 +  - Error:<code>
 +WARNING: C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=g++)
 +</code>
 +Install nodejs from linux binary: https://github.com/nodejs/help/wiki/Installation
 +  - Step1: Get linux binay<code bash>
 +wget https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz
 +</code>
 +  - Step2: Unzip linux binary to /usr/local/nodejs<code bash>
 +mkdir /usr/local/nodejs
 +yum install xz
 +tar -xJvf node-v8.11.1-linux-x64.tar.xz -C /usr/local/nodejs
 +</code>
 +  - Step3: Set the environment variable ~/.profile or ~/.bash_profile, add below to the end<code bash>
 +# Nodejs
 +export NODEJS_HOME=/usr/local/nodejs/node-v8.11.1/bin
 +export PATH=$NODEJS_HOME:$PATH
 +</code>
 +  - Step4:Refresh profile<code bash>
 +.~/.profile
 +</code>
 +  - Step6: Check environment:<code bash>
 +echo $PATH
 +/usr/local/nodejs/node-v8.11.1/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
 +</code>
 +  - Step5: Test installation using<code bash>
 +node -v
 +npm version
 +</code>output:<code>
 +v8.11.1
 +{ npm: '5.6.0',
 +  ares: '1.10.1-DEV',
 +  cldr: '32.0',
 +  http_parser: '2.8.0',
 +  icu: '60.1',
 +  modules: '57',
 +  nghttp2: '1.25.0',
 +  node: '8.11.1',
 +  openssl: '1.0.2o',
 +  tz: '2017c',
 +  unicode: '10.0',
 +  uv: '1.19.1',
 +  v8: '6.2.414.50',
 +  zlib: '1.2.11' }
 </code> </code>
 ==== npm(node package manager for javascript...) ==== ==== npm(node package manager for javascript...) ====
Line 64: Line 120:
   * install node module:<code bat>   * install node module:<code bat>
 npm install -g <modulename> npm install -g <modulename>
 +</code>(Option: -g -> global modules)
 +  * install all node modules **dependencies in package.json**
 +    * install to  the local node_modules folder<code bat>
 +npm install
 +</code>
 +    * install as global packages:<code bat>
 +npm install -g
 </code> </code>
 ==== Grunt(Javascript Task Runner) ==== ==== Grunt(Javascript Task Runner) ====
Line 505: Line 568:
  
 </code> </code>
-==== Themes for bootstrap ====+==== Themes and templates for bootstrap ====
 refer: refer:
 +  * https://startbootstrap.com/template-categories/all/
   * http://bootswatch.com/: https://github.com/thomaspark/bootswatch   * http://bootswatch.com/: https://github.com/thomaspark/bootswatch
   * http://www.bootstrapzero.com/: https://github.com/iatek/bootstrap-zero   * http://www.bootstrapzero.com/: https://github.com/iatek/bootstrap-zero
webdesign/html5-and-javascript.1472520192.txt.gz · Last modified: 2022/10/29 16:15 (external edit)