{"id":93903,"date":"2025-12-30T11:48:29","date_gmt":"2025-12-30T04:48:29","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=93903"},"modified":"2025-12-30T13:51:52","modified_gmt":"2025-12-30T06:51:52","slug":"huong-dan-npm-install","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/","title":{"rendered":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Lenh_npm_install_dung_de_lam_gi\" >L\u1ec7nh npm install d\u00f9ng \u0111\u1ec3 l\u00e0m g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Su_khac_biet_giua_cai_dat_cuc_bo_local_va_toan_cuc_global_la_gi\" >S\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa c\u00e0i \u0111\u1eb7t c\u1ee5c b\u1ed9 (local) v\u00e0 to\u00e0n c\u1ee5c (global) l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Lenh_npm_install_ho_tro_nhung_tuy_chon_nao\" >L\u1ec7nh npm install h\u1ed7 tr\u1ee3 nh\u1eefng t\u00f9y ch\u1ecdn n\u00e0o?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Co_nhung_cach_cai_dat_npm_va_npm_package_nao\" >C\u00f3 nh\u1eefng c\u00e1ch c\u00e0i \u0111\u1eb7t npm v\u00e0 npm package n\u00e0o?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#File_packagejson_dong_vai_tro_gi_trong_npm\" >File package.json \u0111\u00f3ng vai tr\u00f2 g\u00ec trong npm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Cac_cau_hoi_thuong_gap_ve_npm_install\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p\u00a0v\u1ec1 npm install<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><strong><em>npm install l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh quan tr\u1ecdng nh\u1ea5t khi l\u00e0m vi\u1ec7c v\u1edbi Node.js v\u00e0 npm, gi\u00fap c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i ph\u1ee5 thu\u1ed9c c\u1ea7n thi\u1ebft cho d\u1ef1 \u00e1n. V\u1edbi c\u00fa ph\u00e1p \u0111\u01a1n gi\u1ea3n nh\u01b0ng linh ho\u1ea1t, npm install cho ph\u00e9p l\u1eadp tr\u00ecnh vi\u00ean t\u1ea3i v\u1ec1 c\u00e1c package t\u1eeb registry, c\u1eadp nh\u1eadt dependencies, c\u00e0i \u0111\u1eb7t theo t\u1eebng m\u00f4i tr\u01b0\u1eddng ho\u1eb7c l\u01b0u c\u1ea5u h\u00ecnh v\u00e0o package.json.<\/em><\/strong><\/p>\n\n\n\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft sau \u0111\u1ec3 \u0111\u01b0\u1ee3c gi\u1ea3i \u0111\u00e1p chi ti\u1ebft h\u01a1n v\u1ec1:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u00e2u l\u1ec7nh npm install, bao g\u1ed3m c\u00fa ph\u00e1p, v\u00ed d\u1ee5, c\u00e1ch s\u1eed d\u1ee5ng c\u0169ng nh\u01b0 l\u00fd gi\u1ea3i t\u1ea1i sao c\u00e2u l\u1ec7nh n\u00e0y quan tr\u1ecdng.<\/li>\n\n\n\n<li>M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 c\u01a1 b\u1ea3n c\u1ee7a c\u00e2u l\u1ec7nh npm install.\u00a0<\/li>\n\n\n\n<li>H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t npm v\u00e0 npm package.\u00a0<\/li>\n\n\n\n<li>H\u01b0\u1edbng d\u1eabn c\u00e1ch ki\u1ec3m tra v\u00e0 c\u1eadp nh\u1eadt c\u00e1c phi\u00ean b\u1ea3n c\u1ee7a npm.\u00a0<\/li>\n\n\n\n<li>Package Management v\u1edbi package.json.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <strong><a href=\"https:\/\/itviec.com\/blog\/npm-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">NPM l\u00e0 g\u00ec: Kh\u00e1i ni\u1ec7m, l\u1ec7nh v\u00e0 thao t\u00e1c c\u01a1 b\u1ea3n v\u1edbi NPM<\/a><\/strong><\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-l\u1ec7nh-npm-install-dung-d\u1ec3-lam-gi\"><span class=\"ez-toc-section\" id=\"Lenh_npm_install_dung_de_lam_gi\"><\/span><strong>L\u1ec7nh npm install d\u00f9ng \u0111\u1ec3 l\u00e0m g\u00ec?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>npm install<\/strong> l\u00e0 c\u00e2u l\u1ec7nh s\u1ebd c\u00e0i \u0111\u1eb7t c\u00e1c package v\u00e0 to\u00e0n b\u1ed9 dependencies m\u00e0 ch\u00fang ph\u1ee5 thu\u1ed9c v\u00e0o. N\u1ebfu b\u1ea1n kh\u00f4ng ch\u1ec9 \u0111\u1ecbnh t\u00ean package, npm s\u1ebd t\u1ef1 \u0111\u1ed9ng c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 dependencies \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong t\u1ec7p package.json c\u1ee7a d\u1ef1 \u00e1n.<\/p>\n\n\n\n<p>N\u1ebfu m\u1ed9t g\u00f3i c\u00f3 package-lock, ho\u1eb7c t\u1ec7p npm shrinkwrap th\u00ec vi\u1ec7c c\u00e0i \u0111\u1eb7t c\u00e1c dependencies s\u1ebd d\u1ef1a tr\u00ean c\u00e1c t\u1ec7p \u0111\u00f3, theo th\u1ee9 t\u1ef1 \u01b0u ti\u00ean sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm-shrinkwrap.json<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package-lock.json<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 c\u00e1c dependencies c\u1ee7a d\u1ef1 \u00e1n \u0111\u01b0\u1ee3c \u0111\u1ecbnh ngh\u0129a trong package.json.<\/li>\n\n\n\n<li>C\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i c\u1ee5 th\u1ec3 n\u1ebfu \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh.<\/li>\n\n\n\n<li>C\u1eadp nh\u1eadt dependencies ho\u1eb7c \u0111\u1ea3m b\u1ea3o m\u00f4i tr\u01b0\u1eddng c\u00e0i \u0111\u1eb7t kh\u1edbp v\u1edbi c\u1ea5u h\u00ecnh c\u1ee7a d\u1ef1 \u00e1n.<\/li>\n<\/ul>\n\n\n\n<p>Hi\u1ec3u c\u00e1ch npm install ho\u1ea1t \u0111\u1ed9ng v\u00e0 c\u00e1c t\u00f9y ch\u1ecdn m\u00e0 n\u00f3 h\u1ed7 tr\u1ee3 l\u00e0 \u0111i\u1ec1u r\u1ea5t quan tr\u1ecdng \u0111\u1ec3 qu\u1ea3n l\u00fd d\u1ef1 \u00e1n hi\u1ec7u qu\u1ea3.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cu-phap-c\u01a1-b\u1ea3n-c\u1ee7a-npm-install\"><strong>C\u00fa ph\u00e1p c\u01a1 b\u1ea3n c\u1ee7a npm install<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install &#91;&lt;t\u00ean-package&gt;] &#91;--save-dev] &#91;--global]<\/code><\/pre>\n\n\n\n<p>Trong \u0111\u00f3<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>&lt;package-name><\/code>: <\/strong>T\u00ean c\u1ee7a g\u00f3i (package) m\u00e0 b\u1ea1n mu\u1ed1n c\u00e0i \u0111\u1eb7t.<\/li>\n\n\n\n<li><strong><code>--save-dev<\/code>: <\/strong>C\u00e0i \u0111\u1eb7t g\u00f3i d\u01b0\u1edbi d\u1ea1ng development dependency (ph\u1ee5c v\u1ee5 cho m\u00f4i tr\u01b0\u1eddng ph\u00e1t tri\u1ec3n, kh\u00f4ng c\u1ea7n khi ch\u1ea1y d\u1ef1 \u00e1n \u1edf production).<\/li>\n\n\n\n<li><strong><code>--global<\/code> (ho\u1eb7c <code>-g<\/code>): <\/strong>C\u00e0i \u0111\u1eb7t g\u00f3i \u1edf to\u00e0n c\u1ee5c, \u0111\u1ec3 c\u00f3 th\u1ec3 d\u00f9ng trong b\u1ea5t k\u1ef3 d\u1ef1 \u00e1n n\u00e0o tr\u00ean m\u00e1y.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-s\u1ef1-khac-bi\u1ec7t-gi\u1eefa-cai-d\u1eb7t-c\u1ee5c-b\u1ed9-local-va-toan-c\u1ee5c-global-la-gi\"><span class=\"ez-toc-section\" id=\"Su_khac_biet_giua_cai_dat_cuc_bo_local_va_toan_cuc_global_la_gi\"><\/span><strong>S\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa c\u00e0i \u0111\u1eb7t c\u1ee5c b\u1ed9 (local) v\u00e0 to\u00e0n c\u1ee5c (global) l\u00e0 g\u00ec?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Trong npm c\u00f3 hai ki\u1ec3u c\u00e0i \u0111\u1eb7t g\u00f3i: c\u1ee5c b\u1ed9 (local) v\u00e0 to\u00e0n c\u1ee5c (global).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>C\u00e0i \u0111\u1eb7t c\u1ee5c b\u1ed9<\/strong> l\u00e0 thi\u1ebft l\u1eadp m\u1eb7c \u0111\u1ecbnh, khi ch\u1ea1y npm install, npm s\u1ebd c\u00e0i g\u00f3i v\u00e0o th\u01b0 m\u1ee5c node_modules trong d\u1ef1 \u00e1n hi\u1ec7n t\u1ea1i. C\u00e1c g\u00f3i n\u00e0y ch\u1ec9 kh\u1ea3 d\u1ee5ng cho d\u1ef1 \u00e1n \u0111\u00f3, kh\u00f4ng th\u1ec3 d\u00f9ng cho d\u1ef1 \u00e1n kh\u00e1c.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install lodash<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh tr\u00ean s\u1ebd c\u00e0i lodash v\u00e0o th\u01b0 m\u1ee5c node_modules c\u1ee7a d\u1ef1 \u00e1n v\u00e0 th\u00eam n\u00f3 v\u00e0o file package.json trong ph\u1ea7n dependencies.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>C\u00e0i \u0111\u1eb7t to\u00e0n c\u1ee5c <\/strong>th\u01b0\u1eddng d\u00f9ng cho nh\u1eefng g\u00f3i c\u1ea7n \u0111\u01b0\u1ee3c truy c\u1eadp t\u1eeb b\u1ea5t k\u1ef3 \u0111\u00e2u trong h\u1ec7 th\u1ed1ng, v\u00ed d\u1ee5 nh\u01b0 c\u00e1c c\u00f4ng c\u1ee5 ch\u1ea1y tr\u00ean d\u00f2ng l\u1ec7nh (CLI tools). Khi c\u00e0i g\u00f3i to\u00e0n c\u1ee5c, n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c d\u00f9ng chung cho m\u1ecdi d\u1ef1 \u00e1n tr\u00ean m\u00e1y.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g nodemon<\/code><\/pre>\n\n\n\n<p>Sau khi c\u00e0i, nodemon s\u1ebd c\u00f3 s\u1eb5n tr\u00ean to\u00e0n h\u1ec7 th\u1ed1ng, v\u00e0 b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng n\u00f3 trong b\u1ea5t k\u1ef3 d\u1ef1 \u00e1n n\u00e0o.<\/p>\n\n\n\n<p>Tuy nhi\u00ean, n\u1ebfu b\u1ea1n ch\u1ea1y npm install &lt;package-name&gt; khi ch\u01b0a c\u00f3 t\u1ec7p package.json (ngh\u0129a l\u00e0 ch\u01b0a ch\u1ea1y npm init), npm v\u1eabn s\u1ebd c\u00e0i \u0111\u1eb7t g\u00f3i v\u00e0o th\u01b0 m\u1ee5c node_modules c\u1ee5c b\u1ed9 nh\u01b0 th\u01b0\u1eddng. \u0110i\u1ec1u kh\u00e1c bi\u1ec7t l\u00e0 npm s\u1ebd kh\u00f4ng ghi l\u1ea1i th\u00f4ng tin g\u00f3i n\u00e0y v\u00e0o b\u1ea5t k\u1ef3 danh s\u00e1ch ph\u1ee5 thu\u1ed9c (dependencies) n\u00e0o, v\u00ec t\u1ec7p package.json ch\u01b0a \u0111\u01b0\u1ee3c t\u1ea1o. \u0110i\u1ec1u n\u00e0y c\u00f3 th\u1ec3 khi\u1ebfn vi\u1ec7c t\u00e1i t\u1ea1o m\u00f4i tr\u01b0\u1eddng d\u1ef1 \u00e1n sau n\u00e0y tr\u1edf n\u00ean kh\u00f3 kh\u0103n h\u01a1n.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-l\u1ec7nh-npm-install-h\u1ed7-tr\u1ee3-nh\u1eefng-tuy-ch\u1ecdn-nao\"><span class=\"ez-toc-section\" id=\"Lenh_npm_install_ho_tro_nhung_tuy_chon_nao\"><\/span><strong>L\u1ec7nh npm install h\u1ed7 tr\u1ee3 nh\u1eefng t\u00f9y ch\u1ecdn n\u00e0o?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>L\u1ec7nh npm install h\u1ed7 tr\u1ee3 nhi\u1ec1u t\u00f9y ch\u1ecdn h\u1eefu \u00edch \u0111\u1ec3 m\u1edf r\u1ed9ng ch\u1ee9c n\u0103ng, bao g\u1ed3m:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>--save<\/code>: <\/strong>Th\u00eam package \u0111\u00e3 c\u00e0i \u0111\u1eb7t v\u00e0o m\u1ee5c dependencies trong package.json. Tuy nhi\u00ean, t\u1eeb npm5, l\u1ec7nh save \u0111\u00e3 tr\u1edf th\u00e0nh h\u00e0nh vi m\u1eb7c \u0111\u1ecbnh, kh\u00f4ng c\u1ea7n d\u00f9ng flag n\u00e0y n\u1eefa.\u00a0<\/li>\n\n\n\n<li><strong><code>--save-dev<\/code>:<\/strong> Th\u00eam package \u0111\u00e3 c\u00e0i \u0111\u1eb7t v\u00e0o m\u1ee5c devDependencies, ch\u1ec9 d\u00f9ng trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n.<\/li>\n\n\n\n<li><strong><code>-g<\/code> ho\u1eb7c <code>--global<\/code>:<\/strong> C\u00e0i \u0111\u1eb7t package \u1edf ph\u1ea1m vi to\u00e0n h\u1ec7 th\u1ed1ng, gi\u00fap s\u1eed d\u1ee5ng \u0111\u01b0\u1ee3c \u1edf m\u1ecdi n\u01a1i.<\/li>\n\n\n\n<li><strong><code>--no-save<\/code>:<\/strong> Ng\u0103n kh\u00f4ng cho th\u00eam package \u0111\u00e3 c\u00e0i \u0111\u1eb7t v\u00e0o package.json.<\/li>\n\n\n\n<li><strong><code>--legacy-peer-deps<\/code>:<\/strong> B\u1ecf qua c\u1ea3nh b\u00e1o v\u1ec1 peer dependencies v\u00e0 v\u1eabn c\u00e0i \u0111\u1eb7t package.<\/li>\n<\/ul>\n\n\n\n<p>\u0110\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 c\u00e1ch ho\u1ea1t \u0111\u1ed9ng c\u1ee7a npm install, b\u1ea1n c\u00f3 th\u1ec3 tham kh\u1ea3o 2 v\u00ed d\u1ee5 sau<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-vi-d\u1ee5-1-cai-d\u1eb7t-t\u1ea5t-c\u1ea3-dependencies-c\u1ee7a-d\u1ef1-an\"><strong>V\u00ed d\u1ee5 1: C\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 dependencies c\u1ee7a d\u1ef1 \u00e1n<\/strong><\/h3>\n\n\n\n<p>N\u1ebfu b\u1ea1n clone m\u1ed9t d\u1ef1 \u00e1n \u0111\u00e3 c\u00f3 s\u1eb5n file package.json, b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t to\u00e0n b\u1ed9 dependencies c\u1ea7n thi\u1ebft ch\u1ec9 v\u1edbi l\u1ec7nh:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install<\/code><\/pre>\n\n\n\n<p>npm install trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y gi\u00fap b\u1ea1n t\u00e1i t\u1ea1o l\u1ea1i m\u00f4i tr\u01b0\u1eddng ph\u00e1t tri\u1ec3n c\u1ee7a d\u1ef1 \u00e1n ch\u1ec9 v\u1edbi m\u1ed9t d\u00f2ng l\u1ec7nh.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>npm s\u1ebd \u0111\u1ecdc file package.json.<\/li>\n\n\n\n<li>T\u1ef1 \u0111\u1ed9ng t\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 dependencies \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea.<\/li>\n\n\n\n<li>\u0110\u1eb7t ch\u00fang v\u00e0o th\u01b0 m\u1ee5c node_modules trong d\u1ef1 \u00e1n.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-vi-d\u1ee5-2-cai-d\u1eb7t-m\u1ed9t-goi-c\u1ee5-th\u1ec3\"><strong>V\u00ed d\u1ee5 2: C\u00e0i \u0111\u1eb7t m\u1ed9t g\u00f3i c\u1ee5 th\u1ec3<\/strong><\/h3>\n\n\n\n<p>\u0110\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t g\u00f3i c\u1ee5 th\u1ec3, v\u00ed d\u1ee5 nh\u01b0 lodash, v\u00e0 th\u00eam n\u00f3 v\u00e0o danh s\u00e1ch dependencies trong t\u1ec7p package.json, b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng l\u1ec7nh sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install lodash<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh n\u00e0y s\u1ebd t\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t g\u00f3i lodash t\u1eeb npm registry v\u1ec1 d\u1ef1 \u00e1n. Vi\u1ec7c th\u00eam v\u00e0o dependencies c\u00f3 ngh\u0129a l\u00e0 lodash \u0111\u01b0\u1ee3c coi l\u00e0 g\u00f3i c\u1ea7n thi\u1ebft cho d\u1ef1 \u00e1n khi ch\u1ea1y (runtime). N\u1ebfu b\u1ea1n chia s\u1ebb d\u1ef1 \u00e1n n\u00e0y cho ng\u01b0\u1eddi kh\u00e1c, ch\u1ec9 c\u1ea7n h\u1ecd ch\u1ea1y npm install th\u00ec lodash s\u1ebd \u0111\u01b0\u1ee3c t\u1ef1 \u0111\u1ed9ng t\u1ea3i v\u1ec1.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-co-nh\u1eefng-cach-cai-d\u1eb7t-npm-va-npm-package-nao\"><span class=\"ez-toc-section\" id=\"Co_nhung_cach_cai_dat_npm_va_npm_package_nao\"><\/span><strong>C\u00f3 nh\u1eefng c\u00e1ch c\u00e0i \u0111\u1eb7t npm v\u00e0 npm package n\u00e0o?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-module-qua-npm-install\"><strong>C\u00e0i \u0111\u1eb7t module qua npm install<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install &lt;module&gt;<\/code><\/pre>\n\n\n\n<p>Trong l\u1ec7nh tr\u00ean, b\u1ea1n s\u1ebd thay &lt;module&gt; b\u1eb1ng t\u00ean c\u1ee7a module m\u00e0 b\u1ea1n mu\u1ed1n c\u00e0i \u0111\u1eb7t. V\u00ed d\u1ee5, n\u1ebfu b\u1ea1n mu\u1ed1n c\u00e0i \u0111\u1eb7t Express (framework web c\u1ee7a Node.js n\u1ed5i ti\u1ebfng v\u00e0 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng nhi\u1ec1u nh\u1ea5t), b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y l\u1ec7nh sau<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install express<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh tr\u00ean s\u1ebd c\u00e0i \u0111\u1eb7t module express v\u00e0o th\u01b0 m\u1ee5c \/node_modules trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i. M\u1ed7i khi b\u1ea1n c\u00e0i \u0111\u1eb7t m\u1ed9t module t\u1eeb npm, n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u v\u00e0o th\u01b0 m\u1ee5c node_modules.<\/p>\n\n\n\n<p>Ngo\u00e0i vi\u1ec7c c\u00e0i \u0111\u1eb7t m\u1ed9t module ri\u00eang l\u1ebb, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 c\u00e1c module \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong dependencies v\u00e0 devDependencies c\u1ee7a file package.json trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i. \u0110\u1ec3 l\u00e0m \u0111i\u1ec1u \u0111\u00f3, b\u1ea1n ch\u1ec9 c\u1ea7n ch\u1ea1y l\u1ec7nh n\u00e0y<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install<\/code><\/pre>\n\n\n\n<p>Khi b\u1ea1n ch\u1ea1y l\u1ec7nh n\u00e0y, npm s\u1ebd b\u1eaft \u0111\u1ea7u qu\u00e1 tr\u00ecnh c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 c\u00e1c dependencies c\u1ee7a d\u1ef1 \u00e1n hi\u1ec7n t\u1ea1i. Ngo\u00e0i ra, c\u00f3 m\u1ed9t \u0111i\u1ec1u b\u1ea1n n\u00ean l\u01b0u \u00fd: l\u1ec7nh npm install c\u00f3 m\u1ed9t d\u1ea1ng vi\u1ebft t\u1eaft th\u01b0\u1eddng xu\u1ea5t hi\u1ec7n khi l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c module trong h\u1ec7 sinh th\u00e1i npm.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm i<\/code><\/pre>\n\n\n\n<p>\u1ede \u0111\u00e2y, ch\u1eef i thay th\u1ebf cho install.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-module-va-l\u01b0u-chung-vao-package-json-nh\u01b0-m\u1ed9t-dependency\"><strong>C\u00e0i \u0111\u1eb7t module v\u00e0 l\u01b0u ch\u00fang v\u00e0o package.json nh\u01b0 m\u1ed9t dependency<\/strong><\/h3>\n\n\n\n<p>T\u01b0\u01a1ng t\u1ef1 nh\u01b0 v\u1edbi npm init, l\u1ec7nh npm install c\u0169ng c\u00f3 m\u1ed9t (ho\u1eb7c v\u00e0i) flag m\u00e0 b\u1ea1n s\u1ebd th\u1ea5y h\u1eefu \u00edch trong qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c gi\u00fap ti\u1ebft ki\u1ec7m th\u1eddi gian v\u00e0 c\u00f4ng s\u1ee9c khi thao t\u00e1c v\u1edbi file package.json c\u1ee7a d\u1ef1 \u00e1n.<\/p>\n\n\n\n<p>Khi b\u1ea1n ch\u1ea1y l\u1ec7nh <code>npm install<\/code> \u0111\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t module, b\u1ea1n c\u00f3 th\u1ec3 th\u00eam flag t\u00f9y ch\u1ecdn <code>\u2013save <\/code>v\u00e0o l\u1ec7nh. Flag n\u00e0y s\u1ebd th\u00eam module \u0111\u00f3 nh\u01b0 m\u1ed9t dependency c\u1ee7a d\u1ef1 \u00e1n v\u00e0 ghi n\u00f3 v\u00e0o m\u1ee5c dependencies trong file package.json.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install &lt;module> --save # Trong \u0111\u00f3 &lt;module> l\u00e0 t\u00ean c\u1ee7a module m\u00e0 b\u1ea1n mu\u1ed1n c\u00e0i \u0111\u1eb7t<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-module-va-l\u01b0u-chung-vao-package-json-nh\u01b0-m\u1ed9t-developer-dependency\"><strong>C\u00e0i \u0111\u1eb7t module v\u00e0 l\u01b0u ch\u00fang v\u00e0o package.json nh\u01b0 m\u1ed9t Developer Dependency<\/strong><\/h3>\n\n\n\n<p>C\u00f3 m\u1ed9t flag g\u1ea7n nh\u01b0 gi\u1ed1ng h\u1ec7t v\u1ec1 m\u1eb7t ch\u1ee9c n\u0103ng so v\u1edbi <code>--save<\/code> khi c\u00e0i \u0111\u1eb7t m\u1ed9t module, \u0111\u00f3 l\u00e0: <code>--save-dev<\/code><\/p>\n\n\n\n<p>Tuy nhi\u00ean, c\u00f3 m\u1ed9t v\u00e0i \u0111i\u1ec3m kh\u00e1c bi\u1ec7t quan tr\u1ecdng: thay v\u00ec l\u01b0u module \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0o m\u1ee5c dependencies trong package.json, th\u00ec &#8211;save-dev s\u1ebd l\u01b0u n\u00f3 v\u00e0o m\u1ee5c devDependencies.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>dependencies<\/strong>: d\u00e0nh cho m\u00f4i tr\u01b0\u1eddng production \u2013 t\u1ee9c l\u00e0 nh\u1eefng module c\u1ea7n thi\u1ebft \u0111\u1ec3 d\u1ef1 \u00e1n ho\u1ea1t \u0111\u1ed9ng khi \u0111\u01b0a v\u00e0o ch\u1ea1y th\u1ef1c t\u1ebf.<\/li>\n\n\n\n<li><strong>devDependencies<\/strong>: l\u00e0 t\u1eadp h\u1ee3p c\u00e1c module ch\u1ec9 ph\u1ee5c v\u1ee5 trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng, t\u1ee9c l\u00e0 b\u1ea1n c\u1ea7n ch\u00fang \u0111\u1ec3 x\u00e2y d\u1ef1ng d\u1ef1 \u00e1n, nh\u01b0ng khi \u1ee9ng d\u1ee5ng ch\u1ea1y th\u1ef1c t\u1ebf th\u00ec kh\u00f4ng c\u1ea7n \u0111\u1ebfn.<\/li>\n<\/ul>\n\n\n\n<p>C\u00e1c module trong devDependencies th\u01b0\u1eddng bao g\u1ed3m nh\u1eefng c\u00f4ng c\u1ee5 nh\u01b0: c\u00f4ng c\u1ee5 ki\u1ec3m th\u1eed (testing tools), server c\u1ee5c b\u1ed9 \u0111\u1ec3 h\u1ed7 tr\u1ee3 ph\u00e1t tri\u1ec3n nhanh h\u01a1n, v\u00e0 nhi\u1ec1u ti\u1ec7n \u00edch kh\u00e1c.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-module-toan-c\u1ee5c-globally-tren-h\u1ec7-th\u1ed1ng\"><strong>C\u00e0i \u0111\u1eb7t module to\u00e0n c\u1ee5c (globally) tr\u00ean h\u1ec7 th\u1ed1ng<\/strong><\/h3>\n\n\n\n<p>Flag cu\u1ed1i c\u00f9ng, c\u0169ng l\u00e0 flag th\u01b0\u1eddng g\u1eb7p nh\u1ea5t c\u1ee7a l\u1ec7nh npm install m\u00e0 b\u1ea1n n\u00ean bi\u1ebft, \u0111\u00f3 l\u00e0 flag d\u00f9ng \u0111\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t module to\u00e0n c\u1ee5c tr\u00ean h\u1ec7 th\u1ed1ng.<\/p>\n\n\n\n<p>C\u00e1c module \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t to\u00e0n c\u1ee5c c\u00f3 th\u1ec3 c\u1ef1c k\u1ef3 h\u1eefu \u00edch. Ch\u00fang c\u00f3 r\u1ea5t nhi\u1ec1u c\u00f4ng c\u1ee5, ti\u1ec7n \u00edch v\u00e0 nhi\u1ec1u th\u1ee9 kh\u00e1c d\u00e0nh cho c\u1ea3 ph\u00e1t tri\u1ec3n l\u1eabn s\u1eed d\u1ee5ng chung m\u00e0 b\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t \u0111\u1ec3 d\u00f9ng to\u00e0n h\u1ec7 th\u1ed1ng.<\/p>\n\n\n\n<p>\u0110\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t module t\u1eeb npm theo c\u00e1ch to\u00e0n c\u1ee5c, b\u1ea1n ch\u1ec9 c\u1ea7n th\u00eam flag \u2013global (ho\u1eb7c vi\u1ebft t\u1eaft l\u00e0 -g) khi ch\u1ea1y l\u1ec7nh c\u00e0i \u0111\u1eb7t. Khi \u0111\u00f3, module s\u1ebd \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t \u1edf ph\u1ea1m vi to\u00e0n h\u1ec7 th\u1ed1ng thay v\u00ec ch\u1ec9 c\u00e0i \u0111\u1eb7t c\u1ee5c b\u1ed9 (local) trong th\u01b0 m\u1ee5c hi\u1ec7n t\u1ea1i.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-packages-qua-omit-dev\"><strong>C\u00e0i \u0111\u1eb7t packages qua &#8211;omit=dev<\/strong><\/h3>\n\n\n\n<p>L\u1ec7nh <code>npm install --omit=dev<\/code> ch\u1ec9 th\u1ecb cho npm c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong c\u00e1c m\u1ee5c dependencies v\u00e0 optionalDependencies c\u1ee7a t\u1ec7p package.json c\u1ee7a b\u1ea1n, nh\u01b0ng kh\u00f4ng c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong m\u1ee5c devDependencies.<\/p>\n\n\n\n<p>L\u1ec7nh n\u00e0y th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong c\u00e1c m\u00f4i tr\u01b0\u1eddng s\u1ea3n xu\u1ea5t (production) ho\u1eb7c khi tri\u1ec3n khai m\u1ed9t \u1ee9ng d\u1ee5ng. \u0110i\u1ec1u n\u00e0y l\u00e0 do devDependencies th\u01b0\u1eddng l\u00e0 c\u00e1c c\u00f4ng c\u1ee5 ch\u1ec9 d\u00f9ng trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n (nh\u01b0 c\u00e1c framework ki\u1ec3m th\u1eed, c\u00f4ng c\u1ee5 linter, ho\u1eb7c c\u00f4ng c\u1ee5 x\u00e2y d\u1ef1ng) v\u00e0 kh\u00f4ng c\u1ea7n thi\u1ebft \u0111\u1ec3 \u1ee9ng d\u1ee5ng ch\u1ea1y \u0111\u01b0\u1ee3c trong m\u00f4i tr\u01b0\u1eddng s\u1ea3n xu\u1ea5t.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --omit=dev<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh n\u00e0y s\u1ebd h\u01b0\u1edbng d\u1eabn npm b\u1ecf qua vi\u1ec7c c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 c\u00e1c g\u00f3i \u0111\u00e3 \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong m\u1ee5c devDependencies c\u1ee7a t\u1ec7p package.json. \u0110i\u1ec1u n\u00e0y r\u1ea5t h\u1eefu \u00edch v\u00e0 l\u00e0 m\u1ed9t ph\u01b0\u01a1ng ph\u00e1p ti\u00eau chu\u1ea9n \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o m\u00f4i tr\u01b0\u1eddng s\u1ea3n xu\u1ea5t c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c g\u1ecdn nh\u1eb9, an to\u00e0n v\u00e0 t\u1ed1i \u01b0u nh\u1ea5t.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-file-package-json-dong-vai-tro-gi-trong-npm\"><span class=\"ez-toc-section\" id=\"File_packagejson_dong_vai_tro_gi_trong_npm\"><\/span><strong>File package.json \u0111\u00f3ng vai tr\u00f2 g\u00ec trong npm?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>File package.json \u0111\u00f3ng vai tr\u00f2 quan tr\u1ecdng trong vi\u1ec7c qu\u1ea3n l\u00fd dependencies c\u1ee7a d\u1ef1 \u00e1n Node.js. N\u00f3 ch\u1ee9a th\u00f4ng tin v\u1ec1 d\u1ef1 \u00e1n, c\u00e1c dependencies v\u00e0 nh\u1eefng metadata kh\u00e1c.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cai-d\u1eb7t-t\u1ea5t-c\u1ea3-dependencies\"><strong>C\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 dependencies<\/strong><\/h3>\n\n\n\n<p>N\u1ebfu d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n c\u00f3 file package.json li\u1ec7t k\u00ea s\u1eb5n dependencies, ch\u1ec9 c\u1ea7n ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 c\u00e0i \u0111\u1eb7t to\u00e0n b\u1ed9.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install<\/code><\/pre>\n\n\n\n<p>Npm s\u1ebd t\u1ef1 \u0111\u1ed9ng c\u00e0i \u0111\u1eb7t t\u1ea5t c\u1ea3 dependencies v\u00e0 \u0111\u1eb7t ch\u00fang trong th\u01b0 m\u1ee5c node_modules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-them-m\u1ed9t-dependency-m\u1edbi\"><strong>Th\u00eam m\u1ed9t dependency m\u1edbi<\/strong><\/h3>\n\n\n\n<p>\u0110\u1ec3 th\u00eam m\u1ed9t dependency m\u1edbi v\u00e0 l\u01b0u n\u00f3 v\u00e0o package.json, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y c\u00e2u l\u1ec7nh sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install express<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh n\u00e0y s\u1ebd c\u00e0i \u0111\u1eb7t g\u00f3i express v\u00e0 t\u1ef1 \u0111\u1ed9ng th\u00eam n\u00f3 v\u00e0o m\u1ee5c dependencies trong package.json.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-them-dependencies-cho-moi-tr\u01b0\u1eddng-phat-tri\u1ec3n\"><strong>Th\u00eam dependencies cho m\u00f4i tr\u01b0\u1eddng ph\u00e1t tri\u1ec3n<\/strong><\/h3>\n\n\n\n<p>Development dependencies l\u00e0 nh\u1eefng g\u00f3i ch\u1ec9 c\u1ea7n thi\u1ebft trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n, ch\u1eb3ng h\u1ea1n nh\u01b0 framework ki\u1ec3m th\u1eed ho\u1eb7c c\u00f4ng c\u1ee5 build. Ta c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t b\u1eb1ng c\u1edd &#8211;save-dev<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install jest --save-dev<\/code><\/pre>\n\n\n\n<p>L\u1ec7nh n\u00e0y s\u1ebd th\u00eam jest v\u00e0o m\u1ee5c devDependencies trong package.json.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-npm-install\"><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_npm_install\"><\/span><strong>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p\u00a0v\u1ec1 npm install<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-lam-th\u1ebf-nao-d\u1ec3-cai-d\u1eb7t-va-g\u1ee1-b\u1ecf-m\u1ed9t-package-b\u1eb1ng-npm\"><strong>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 g\u1ee1 b\u1ecf m\u1ed9t package b\u1eb1ng npm?<\/strong><\/h3>\n\n\n\n<p>\u0110\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t package, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh npm install k\u00e8m theo t\u00ean package. Ch\u1eb3ng h\u1ea1n nh\u01b0 c\u00e2u l\u1ec7nh <code>npm install package-name<\/code>.\u00a0<\/p>\n\n\n\n<p>B\u00ean c\u1ea1nh \u0111\u00f3, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 g\u1ee1 b\u1ecf m\u1ed9t package b\u1eb1ng l\u1ec7nh npm uninstall k\u00e8m theo t\u00ean package. V\u00ed d\u1ee5: <code>npm uninstall package-name<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-co-th\u1ec3-s\u1eed-d\u1ee5ng-npm-cho-phat-tri\u1ec3n-web-front-end-v\u1edbi-javascript-va-html-khong\"><strong>C\u00f3 th\u1ec3 s\u1eed d\u1ee5ng npm cho ph\u00e1t tri\u1ec3n web front-end v\u1edbi JavaScript v\u00e0 HTML kh\u00f4ng?<\/strong><\/h3>\n\n\n\n<p>C\u00f3. M\u1eb7c d\u00f9 npm th\u01b0\u1eddng g\u1eafn li\u1ec1n v\u1edbi Node.js \u1edf back-end, nh\u01b0ng n\u00f3 c\u0169ng r\u1ea5t h\u1eefu \u00edch cho front-end development. V\u1edbi npm, b\u1ea1n c\u00f3 th\u1ec3:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C\u00e0i \u0111\u1eb7t th\u01b0 vi\u1ec7n JavaScript (v\u00ed d\u1ee5 React, Vue, jQuery).<\/li>\n\n\n\n<li>Qu\u1ea3n l\u00fd c\u00e1c c\u00f4ng c\u1ee5 build nh\u01b0 Webpack, Babel.<\/li>\n\n\n\n<li>D\u00f9ng script t\u1ef1 \u0111\u1ed9ng h\u00f3a (minify, bundle, linting).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-lam-th\u1ebf-nao-d\u1ec3-c\u1eadp-nh\u1eadt-t\u1ea5t-c\u1ea3-dependencies-trong-d\u1ef1-an-b\u1eb1ng-npm\"><strong>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 c\u1eadp nh\u1eadt t\u1ea5t c\u1ea3 dependencies trong d\u1ef1 \u00e1n b\u1eb1ng npm?<\/strong><\/h3>\n\n\n\n<p>\u0110\u1ec3 c\u1eadp nh\u1eadt t\u1ea5t c\u1ea3 dependencies trong d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y l\u1ec7nh npm update. L\u1ec7nh n\u00e0y s\u1ebd c\u1eadp nh\u1eadt c\u00e1c dependencies l\u00ean phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t t\u01b0\u01a1ng th\u00edch, d\u1ef1a tr\u00ean c\u1ea5u h\u00ecnh \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh trong file package.json.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-npm-v\u1edbi-cac-l\u1ec7nh-npm-ci-nh\u01b0-th\u1ebf-nao\"><strong>npm v\u1edbi c\u00e1c l\u1ec7nh npm ci nh\u01b0 th\u1ebf n\u00e0o?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>npm install: <\/strong>D\u00f9ng trong giai \u0111o\u1ea1n ph\u00e1t tri\u1ec3n \u0111\u1ec3 c\u00e0i \u0111\u1eb7t v\u00e0 c\u1eadp nh\u1eadt dependencies, \u0111\u1ed3ng th\u1eddi cho ph\u00e9p th\u00eam t\u1eebng th\u01b0 vi\u1ec7n ri\u00eang l\u1ebb. L\u1ec7nh n\u00e0y linh ho\u1ea1t nh\u01b0ng c\u00f3 th\u1ec3 l\u00e0m thay \u0111\u1ed5i package-lock.json.<\/li>\n\n\n\n<li><strong>npm ci:<\/strong> D\u00f9ng trong m\u00f4i tr\u01b0\u1eddng CI\/CD \u0111\u1ec3 c\u00e0i \u0111\u1eb7t s\u1ea1ch v\u00e0 ch\u00ednh x\u00e1c theo package-lock.json. L\u1ec7nh n\u00e0y \u0111\u1ea3m b\u1ea3o build \u1ed5n \u0111\u1ecbnh, nh\u1ea5t qu\u00e1n v\u00e0 nhanh h\u01a1n so v\u1edbi npm install.<\/li>\n<\/ul>\n\n\n\n<p>H\u00e3y c\u00f9ng xem chi ti\u1ebft nh\u1eefng \u0111i\u1ec3m kh\u00e1c bi\u1ec7t ch\u00ednh gi\u1eefa hai l\u1ec7nh n\u00e0y qua b\u1ea3ng d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><td><strong>npm install<\/strong><\/td><td><strong>npm ci<\/strong><\/td><\/tr><tr><td>M\u1ee5c \u0111\u00edch s\u1eed d\u1ee5ng<\/td><td>Ph\u00e1t tri\u1ec3n t\u01b0\u01a1ng t\u00e1c<\/td><td>T\u00edch h\u1ee3p li\u00ean t\u1ee5c (CI) v\u00e0 c\u00e0i \u0111\u1eb7t s\u1ea1ch<\/td><\/tr><tr><td>Y\u00eau c\u1ea7u package-lock.json<\/td><td>Kh\u00f4ng<\/td><td>C\u00f3<\/td><\/tr><tr><td>X\u1eed l\u00fd khi kh\u00f4ng kh\u1edbp<\/td><td>C\u1eadp nh\u1eadt package-lock.json n\u1ebfu c\u1ea7n<\/td><td>B\u00e1o l\u1ed7i n\u1ebfu package.json v\u00e0 package-lock.json kh\u00f4ng kh\u1edbp<\/td><\/tr><tr><td>C\u00e0i \u0111\u1eb7t m\u1ed9t ph\u1ea7n<\/td><td>Cho ph\u00e9p th\u00eam t\u1eebng dependency ri\u00eang l\u1ebb<\/td><td>Ch\u1ec9 c\u00e0i \u0111\u1eb7t to\u00e0n b\u1ed9 d\u1ef1 \u00e1n<\/td><\/tr><tr><td>X\u1eed l\u00fd th\u01b0 m\u1ee5c node_modules<\/td><td>Gi\u1eef l\u1ea1i th\u01b0 m\u1ee5c hi\u1ec7n c\u00f3<\/td><td>X\u00f3a v\u00e0 t\u1ea1o l\u1ea1i node_modules<\/td><\/tr><tr><td>Thay \u0111\u1ed5i file lock<\/td><td>C\u00f3 th\u1ec3 ch\u1ec9nh s\u1eeda package-lock.json<\/td><td>Kh\u00f4ng bao gi\u1edd ch\u1ec9nh s\u1eeda package-lock.json<\/td><\/tr><tr><td>Ki\u1ec3m tra dependencies<\/td><td>Ki\u1ec3m tra v\u00e0 c\u1eadp nh\u1eadt n\u1ebfu c\u1ea7n thi\u1ebft<\/td><td>B\u1ecf qua b\u01b0\u1edbc ki\u1ec3m tra dependencies<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Nh\u1eefng kh\u00e1c bi\u1ec7t quan tr\u1ecdng n\u00e0y l\u00e0m n\u1ed5i b\u1eadt s\u1ef1 kh\u00e1c nhau c\u1ed1t l\u00f5i gi\u1eefa hai l\u1ec7nh.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>N\u00ean d\u00f9ng npm install trong qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n, khi c\u1ea7n th\u1eed nghi\u1ec7m v\u00e0 \u0111i\u1ec1u ch\u1ec9nh d\u1ef1 \u00e1n.<\/li>\n\n\n\n<li>Khi \u0111\u00e3 ho\u00e0n thi\u1ec7n v\u00e0 mu\u1ed1n build trong m\u00f4i tr\u01b0\u1eddng CI\/CD, h\u00e3y d\u00f9ng npm ci \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o k\u1ebft qu\u1ea3 build \u1ed5n \u0111\u1ecbnh v\u00e0 c\u00f3 th\u1ec3 l\u1eb7p l\u1ea1i cho c\u00e1c b\u1ea3n ph\u00e1t h\u00e0nh s\u1ea3n ph\u1ea9m.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft\"><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><strong>T\u1ed5ng k\u1ebft<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>npm install<\/strong> kh\u00f4ng ch\u1ec9 \u0111\u01a1n thu\u1ea7n l\u00e0 l\u1ec7nh c\u00e0i \u0111\u1eb7t package m\u00e0 c\u00f2n l\u00e0 c\u00f4ng c\u1ee5 gi\u00fap qu\u1ea3n l\u00fd v\u00e0 t\u1ed1i \u01b0u to\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng ph\u1ee5 thu\u1ed9c trong d\u1ef1 \u00e1n Node.js. Khi hi\u1ec3u r\u00f5 c\u00e1c t\u00f9y ch\u1ecdn, c\u00e1ch v\u1eadn h\u00e0nh v\u00e0 m\u1eb9o s\u1eed d\u1ee5ng, b\u1ea1n s\u1ebd ti\u1ebft ki\u1ec7m th\u1eddi gian, h\u1ea1n ch\u1ebf l\u1ed7i v\u00e0 n\u00e2ng cao hi\u1ec7u su\u1ea5t l\u00e0m vi\u1ec7c.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>npm install l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh quan tr\u1ecdng nh\u1ea5t khi l\u00e0m vi\u1ec7c v\u1edbi Node.js v\u00e0 npm, gi\u00fap c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i ph\u1ee5 thu\u1ed9c c\u1ea7n thi\u1ebft cho d\u1ef1 \u00e1n. V\u1edbi c\u00fa ph\u00e1p \u0111\u01a1n gi\u1ea3n nh\u01b0ng linh ho\u1ea1t, npm install cho ph\u00e9p l\u1eadp tr\u00ecnh vi\u00ean t\u1ea3i v\u1ec1 c\u00e1c package t\u1eeb registry, c\u1eadp nh\u1eadt dependencies, c\u00e0i \u0111\u1eb7t [&hellip;]<\/p>\n","protected":false},"author":95,"featured_media":93907,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-93903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package - ITviec Blog<\/title>\n<meta name=\"description\" content=\"T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 npm install. \u0110\u00e2y l\u00e0 l\u1ec7nh c\u01a1 b\u1ea3n v\u00e0 quan tr\u1ecdng trong Node.js gi\u00fap qu\u1ea3n l\u00fd, c\u00e0i \u0111\u1eb7t, c\u1eadp nh\u1eadt v\u00e0 t\u1ed1i \u01b0u g\u00f3i package.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package\" \/>\n<meta property=\"og:description\" content=\"npm install l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh quan tr\u1ecdng nh\u1ea5t khi l\u00e0m vi\u1ec7c v\u1edbi Node.js v\u00e0 npm, gi\u00fap c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i ph\u1ee5 thu\u1ed9c c\u1ea7n thi\u1ebft cho d\u1ef1 \u00e1n. V\u1edbi c\u00fa ph\u00e1p \u0111\u01a1n\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-30T04:48:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-30T06:51:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"421\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tuong Uyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tuong Uyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package - ITviec Blog","description":"T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 npm install. \u0110\u00e2y l\u00e0 l\u1ec7nh c\u01a1 b\u1ea3n v\u00e0 quan tr\u1ecdng trong Node.js gi\u00fap qu\u1ea3n l\u00fd, c\u00e0i \u0111\u1eb7t, c\u1eadp nh\u1eadt v\u00e0 t\u1ed1i \u01b0u g\u00f3i package.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/","og_locale":"vi_VN","og_type":"article","og_title":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package","og_description":"npm install l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ec7nh quan tr\u1ecdng nh\u1ea5t khi l\u00e0m vi\u1ec7c v\u1edbi Node.js v\u00e0 npm, gi\u00fap c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i ph\u1ee5 thu\u1ed9c c\u1ea7n thi\u1ebft cho d\u1ef1 \u00e1n. V\u1edbi c\u00fa ph\u00e1p \u0111\u01a1n","og_url":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-12-30T04:48:29+00:00","article_modified_time":"2025-12-30T06:51:52+00:00","og_image":[{"width":800,"height":421,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png","type":"image\/png"}],"author":"Tuong Uyen","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Tuong Uyen","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"13 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/"},"author":{"name":"Tuong Uyen","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/e97d0e359f8840eaea7dc3a96006a8d4"},"headline":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package","datePublished":"2025-12-30T04:48:29+00:00","dateModified":"2025-12-30T06:51:52+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/"},"wordCount":3504,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/","url":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/","name":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png","datePublished":"2025-12-30T04:48:29+00:00","dateModified":"2025-12-30T06:51:52+00:00","description":"T\u00ecm hi\u1ec3u chi ti\u1ebft v\u1ec1 npm install. \u0110\u00e2y l\u00e0 l\u1ec7nh c\u01a1 b\u1ea3n v\u00e0 quan tr\u1ecdng trong Node.js gi\u00fap qu\u1ea3n l\u00fd, c\u00e0i \u0111\u1eb7t, c\u1eadp nh\u1eadt v\u00e0 t\u1ed1i \u01b0u g\u00f3i package.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/huong-dan-npm-install\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/12\/npm-install-scaled.png","width":800,"height":421,"caption":"npm install - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/huong-dan-npm-install\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"NPM install: H\u01b0\u1edbng d\u1eabn c\u00e1ch c\u00e0i \u0111\u1eb7t v\u00e0 qu\u1ea3n l\u00fd c\u00e1c g\u00f3i package"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/e97d0e359f8840eaea7dc3a96006a8d4","name":"Tuong Uyen","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","caption":"Tuong Uyen"},"url":"https:\/\/itviec.com\/blog\/author\/tuong-uyen-pikachu\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/93903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=93903"}],"version-history":[{"count":3,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/93903\/revisions"}],"predecessor-version":[{"id":93916,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/93903\/revisions\/93916"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/93907"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=93903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=93903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=93903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}