SlideShare a Scribd company logo
npm
您的專屬套件管家
台中前端社群@夢種子
Node.js
Node.js
npm, package manager of node.js
不只是node.js的管理套件
node.js
browsers
angular
bower
gulp
grunt
cordova
react
io.js
mobile
jquery
tessel
nodebots
docpad
npm
我為什麼需要套件管理?
不同專案的需求
開發團隊維護的統一規格
套件的版本控制
套件的相依性
安裝特殊需求的套件例如測試用的套件
好用工具的安裝﹣例如自動化工具、壓縮工具
npm 安裝
1. 到https://nodejs.org 安裝合適版本的node.js
2. 安裝完畢後輸入npm -v,確認npm的版本
3. 透過npm -h 找出npm的指令
4. 例如: npm install -h 用這個指令了解如何使用npm
install
5. 搜尋npm cheat sheet找到快速指令列表
npm installation
npm 安裝指令的標籤
1. -g的意義
2. --save的意義
3. --save-dev的意義
4. 使用-h的觀察
5. <pkg>與@的用途
npm - node_modules
npm - package.json
{
“name”: “my awesome App”,
“version”: “0.0.1”,
“dependencies”: {
“套件名稱”: “版本”
}
}
// npm install 將安裝套件與版本
npm - 透過init協助產生package.json
npm init //初始化專案的npm設定檔
輸入必要的資料
在專案內安裝套件將自動更新
未來可直接更新設定檔的內容
透過npm install管理與維護套件內容
了解版本^與~符號的不同
npm與前端
http://blog.npmjs.org/post/101775448305/npm-and-front-end-packaging
npm是給後端開發使用的
npm只給javascript使用
npm套件的樹狀屬性不適合前端
前端套件相依性的問題不需要npm處理
多組設定檔需要管理
未來的新星 npm-www
#前端工具如gulp.js, browserify, webpack等都需要npm來安裝管理
會後問券
https://goo.gl/ZxCOqk

More Related Content

What's hot

App house
App houseApp house
App house
Fred Chien
 
Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2
twMVC
 
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
Laird Cheng
 
React.js what do you really mean?
React.js what do you really mean?React.js what do you really mean?
React.js what do you really mean?
昱安 周
 
构建基于Lamp的中型网站架构
构建基于Lamp的中型网站架构构建基于Lamp的中型网站架构
构建基于Lamp的中型网站架构
HonestQiao
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
LearningTech
 
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式Will Huang
 
Jenkins 自動測試 (使用 NodeJS)
Jenkins 自動測試 (使用 NodeJS)Jenkins 自動測試 (使用 NodeJS)
Jenkins 自動測試 (使用 NodeJS)
dplayerd
 
Node.js中间件 connect模块深入浅出
Node.js中间件 connect模块深入浅出Node.js中间件 connect模块深入浅出
Node.js中间件 connect模块深入浅出
Eric Xiao
 
Introduce Node.js Taiwan community
Introduce Node.js Taiwan communityIntroduce Node.js Taiwan community
Introduce Node.js Taiwan community
Caesar Chi
 
SITCON 2016 ─ Modern Front-End Workflow with Webpack
SITCON 2016 ─ Modern Front-End Workflow with WebpackSITCON 2016 ─ Modern Front-End Workflow with Webpack
SITCON 2016 ─ Modern Front-End Workflow with Webpack
昱安 周
 
快速打包工具Quick build
快速打包工具Quick build快速打包工具Quick build
快速打包工具Quick build
tb-vertical-guide
 
MakerBoard: MT7688 Emulator
MakerBoard: MT7688 EmulatorMakerBoard: MT7688 Emulator
MakerBoard: MT7688 Emulator
Fred Chien
 
NODEjs Lesson1
NODEjs Lesson1NODEjs Lesson1
NODEjs Lesson13dmodeldiy
 
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
Will Huang
 
Grunt前端自动化工作流
Grunt前端自动化工作流Grunt前端自动化工作流
Grunt前端自动化工作流
sonic0828
 
cygwin安裝與vim
cygwin安裝與vimcygwin安裝與vim
cygwin安裝與vim
PO HSUAN HUANG
 
重构与优化
重构与优化重构与优化
重构与优化Tony Deng
 
BricxCC 與 EV3 樂高機器人螢幕擷取
BricxCC 與 EV3 樂高機器人螢幕擷取BricxCC 與 EV3 樂高機器人螢幕擷取
BricxCC 與 EV3 樂高機器人螢幕擷取
信仁 邱
 

What's hot (20)

App house
App houseApp house
App house
 
Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2Asp.net mvc 從無到有 -twMVC#2
Asp.net mvc 從無到有 -twMVC#2
 
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
使用 Load Balancer 與 Redis 部署 LAMP Server 高併發架構 - Global Azure Taiwan 20200425 ...
 
React.js what do you really mean?
React.js what do you really mean?React.js what do you really mean?
React.js what do you really mean?
 
构建基于Lamp的中型网站架构
构建基于Lamp的中型网站架构构建基于Lamp的中型网站架构
构建基于Lamp的中型网站架构
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
 
Jenkins 自動測試 (使用 NodeJS)
Jenkins 自動測試 (使用 NodeJS)Jenkins 自動測試 (使用 NodeJS)
Jenkins 自動測試 (使用 NodeJS)
 
Node.js中间件 connect模块深入浅出
Node.js中间件 connect模块深入浅出Node.js中间件 connect模块深入浅出
Node.js中间件 connect模块深入浅出
 
Introduce Node.js Taiwan community
Introduce Node.js Taiwan communityIntroduce Node.js Taiwan community
Introduce Node.js Taiwan community
 
SITCON 2016 ─ Modern Front-End Workflow with Webpack
SITCON 2016 ─ Modern Front-End Workflow with WebpackSITCON 2016 ─ Modern Front-End Workflow with Webpack
SITCON 2016 ─ Modern Front-End Workflow with Webpack
 
Paveo Tweak WordPress
Paveo Tweak WordPressPaveo Tweak WordPress
Paveo Tweak WordPress
 
快速打包工具Quick build
快速打包工具Quick build快速打包工具Quick build
快速打包工具Quick build
 
MakerBoard: MT7688 Emulator
MakerBoard: MT7688 EmulatorMakerBoard: MT7688 Emulator
MakerBoard: MT7688 Emulator
 
NODEjs Lesson1
NODEjs Lesson1NODEjs Lesson1
NODEjs Lesson1
 
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
保哥線上講堂:利用 StyleCop 撰寫一致的 C# 程式碼風格
 
Grunt前端自动化工作流
Grunt前端自动化工作流Grunt前端自动化工作流
Grunt前端自动化工作流
 
cygwin安裝與vim
cygwin安裝與vimcygwin安裝與vim
cygwin安裝與vim
 
重构与优化
重构与优化重构与优化
重构与优化
 
BricxCC 與 EV3 樂高機器人螢幕擷取
BricxCC 與 EV3 樂高機器人螢幕擷取BricxCC 與 EV3 樂高機器人螢幕擷取
BricxCC 與 EV3 樂高機器人螢幕擷取
 

Viewers also liked

TDC SP 2015 - PHP7: better & faster
TDC SP 2015 - PHP7: better & fasterTDC SP 2015 - PHP7: better & faster
TDC SP 2015 - PHP7: better & faster
Bruno Ricardo Siqueira
 
High Performance Solution for PHP7
High Performance Solution for PHP7High Performance Solution for PHP7
High Performance Solution for PHP7
Xinchen Hui
 
NPM THE GUIDE
NPM THE GUIDENPM THE GUIDE
NPM THE GUIDE
Kameron Tanseli
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016
Colin O'Dell
 
Web crawlers with reinforcement learning
Web crawlers with reinforcement learningWeb crawlers with reinforcement learning
Web crawlers with reinforcement learning
Mohammed Ashour
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
Narudom Roongsiriwong, CISSP
 
PHP 7 - Above and Beyond
PHP 7 - Above and BeyondPHP 7 - Above and Beyond
PHP 7 - Above and Beyond
rafaelfqf
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.js
Suroor Wijdan
 
Php vs asp
Php vs aspPhp vs asp
Php vs asp
umesh patil
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
Xinchen Hui
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
Xinchen Hui
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
Xinchen Hui
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
Narudom Roongsiriwong, CISSP
 
The secret of PHP7's Performance
The secret of PHP7's Performance The secret of PHP7's Performance
The secret of PHP7's Performance
Xinchen Hui
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
Colin O'Dell
 
Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
Narudom Roongsiriwong, CISSP
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
Narudom Roongsiriwong, CISSP
 
Simple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlSimple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with Perl
Kent Cowgill
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & Performance
Xinchen Hui
 
Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016
Colin O'Dell
 

Viewers also liked (20)

TDC SP 2015 - PHP7: better & faster
TDC SP 2015 - PHP7: better & fasterTDC SP 2015 - PHP7: better & faster
TDC SP 2015 - PHP7: better & faster
 
High Performance Solution for PHP7
High Performance Solution for PHP7High Performance Solution for PHP7
High Performance Solution for PHP7
 
NPM THE GUIDE
NPM THE GUIDENPM THE GUIDE
NPM THE GUIDE
 
Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016Hacking Your Way to Better Security - ZendCon 2016
Hacking Your Way to Better Security - ZendCon 2016
 
Web crawlers with reinforcement learning
Web crawlers with reinforcement learningWeb crawlers with reinforcement learning
Web crawlers with reinforcement learning
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
 
PHP 7 - Above and Beyond
PHP 7 - Above and BeyondPHP 7 - Above and Beyond
PHP 7 - Above and Beyond
 
Introduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.jsIntroduction to NPM and building CLI Tools with Node.js
Introduction to NPM and building CLI Tools with Node.js
 
Php vs asp
Php vs aspPhp vs asp
Php vs asp
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
PHP7 - The New Engine for old good train
PHP7 - The New Engine for old good trainPHP7 - The New Engine for old good train
PHP7 - The New Engine for old good train
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
 
The secret of PHP7's Performance
The secret of PHP7's Performance The secret of PHP7's Performance
The secret of PHP7's Performance
 
Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016Hacking Your Way to Better Security - PHP South Africa 2016
Hacking Your Way to Better Security - PHP South Africa 2016
 
Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
Simple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlSimple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with Perl
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & Performance
 
Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016
 

Similar to Npm node.js的套件管理程式

Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹
wantingj
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Yiwei Ma
 
快快樂樂學 Angular 2 開發框架
快快樂樂學 Angular 2 開發框架快快樂樂學 Angular 2 開發框架
快快樂樂學 Angular 2 開發框架
Will Huang
 
前端自動化工具
前端自動化工具前端自動化工具
前端自動化工具
國昭 張
 
CP 值很高的 Gulp
CP 值很高的 GulpCP 值很高的 Gulp
CP 值很高的 Gulp
Yvonne Yu
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkitLainZQ
 
Nae client(using Node.js to create shell cmd)
Nae client(using Node.js to create shell cmd)Nae client(using Node.js to create shell cmd)
Nae client(using Node.js to create shell cmd)
fisher zheng
 
课题二:Node.js那些事儿
课题二:Node.js那些事儿课题二:Node.js那些事儿
课题二:Node.js那些事儿
Liu Allen
 
5, system admin
5, system admin5, system admin
5, system admin
ted-xu
 
Nagios & puppet
Nagios & puppetNagios & puppet
Nagios & puppet
Jason Shen
 
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
鍾誠 陳鍾誠
 
使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理Jason Zheng
 
使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理haiyuan ning
 
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1redhat9
 
Grunt
Grunt Grunt
Grunt
lylijincheng
 
PHPUnit slide formal
PHPUnit slide formalPHPUnit slide formal
PHPUnit slide formaljameslabs
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用
謝 宗穎
 
Php可调试团队开发环境配置
Php可调试团队开发环境配置Php可调试团队开发环境配置
Php可调试团队开发环境配置
wangkangluo1
 
Php可调试团队开发环境配置
Php可调试团队开发环境配置Php可调试团队开发环境配置
Php可调试团队开发环境配置
xinqi yang
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
Chu-Siang Lai
 

Similar to Npm node.js的套件管理程式 (20)

Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
 
快快樂樂學 Angular 2 開發框架
快快樂樂學 Angular 2 開發框架快快樂樂學 Angular 2 開發框架
快快樂樂學 Angular 2 開發框架
 
前端自動化工具
前端自動化工具前端自動化工具
前端自動化工具
 
CP 值很高的 Gulp
CP 值很高的 GulpCP 值很高的 Gulp
CP 值很高的 Gulp
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit
 
Nae client(using Node.js to create shell cmd)
Nae client(using Node.js to create shell cmd)Nae client(using Node.js to create shell cmd)
Nae client(using Node.js to create shell cmd)
 
课题二:Node.js那些事儿
课题二:Node.js那些事儿课题二:Node.js那些事儿
课题二:Node.js那些事儿
 
5, system admin
5, system admin5, system admin
5, system admin
 
Nagios & puppet
Nagios & puppetNagios & puppet
Nagios & puppet
 
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
 
使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理
 
使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理使用Rpm&yum进行基础软件管理
使用Rpm&yum进行基础软件管理
 
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
Bypat博客出品-利用cent os快速构建自己的发行版-进阶版v1.1
 
Grunt
Grunt Grunt
Grunt
 
PHPUnit slide formal
PHPUnit slide formalPHPUnit slide formal
PHPUnit slide formal
 
從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用從軟體開發角度
談 Docker 的應用
從軟體開發角度
談 Docker 的應用
 
Php可调试团队开发环境配置
Php可调试团队开发环境配置Php可调试团队开发环境配置
Php可调试团队开发环境配置
 
Php可调试团队开发环境配置
Php可调试团队开发环境配置Php可调试团队开发环境配置
Php可调试团队开发环境配置
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
 

Npm node.js的套件管理程式