{"id":5260,"date":"2016-09-01T11:25:48","date_gmt":"2016-09-01T03:25:48","guid":{"rendered":"https:\/\/sdeno.com\/?p=5260"},"modified":"2016-11-12T20:34:10","modified_gmt":"2016-11-12T12:34:10","slug":"%e5%9c%a8ubuntu%e4%b8%ad%e5%ae%89%e8%a3%85node-js%e4%bb%a5%e5%8f%8aexpress%e7%9a%84%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5260","title":{"rendered":"\u5728ubuntu\u4e2d\u5b89\u88c5node.js\u4ee5\u53caexpress\u7684\u90e8\u7f72"},"content":{"rendered":"<pre>\/\/node.js\u7684\u5b89\u88c5\u4f9d\u8d56\u5176\u4ed6\u73af\u5883\uff0c\u9996\u5148\u8981\u66f4\u65b0\u5176\u4ed6\u8f6f\u4ef6\r\napt-get update\r\napt-get install python gcc make g++<\/pre>\n<p>&nbsp;<\/p>\n<pre>\/\/\u5b89\u88c5node.js\u548cnpm\r\nsudo apt install nodejs-legacy\r\nsudo apt install npm<\/pre>\n<p>&nbsp;<\/p>\n<pre>\/\/\u5b89\u88c5express\r\nsudo apt install node-express-generator \/\/\u67e5\u770b\u662f\u5426\u5b89\u88c5\u6210\u529f express -V\r\nsudo apt install node-express<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5173\u4e8e\u5728ubuntu\u4e0b\u4f7f\u7528supervisor\u8ddfwindows\u4e0b\u4f7f\u7528\u4e0d\u592a\u4e00\u6837\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a<\/p>\n<p>\u300a<a href=\"https:\/\/sdeno.com\/?p=5416\" target=\"_blank\">ubuntu\u4e0b\u5b89\u88c5\u4f7f\u7528supervisor\u914d\u5408express\u6d4b\u8bd5<\/a>\u300b<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-\u53e6\u4e00\u79cd\u5b89\u88c5\u65b9\u6cd5&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p style=\"color: #000000;\">\u9996\u5148\u8bf4\u4e0b\u672c\u6587\u7684\u7cfb\u7edf\u73af\u5883\u662f\uff1aUbuntu 16.04 64\u4f4d\uff0c\u672c\u6587\u5185\u5bb9\u4eb2\u6d4b\u53ef\u7528\uff0c \u5927\u5bb6\u53ef\u4ee5\u8bf7\u653e\u5fc3\u501f\u9274\u53c2\u8003\uff0c\u4e0b\u9762\u6765\u4e00\u8d77\u770b\u770b\u8be6\u7ec6\u7684\u6b65\u9aa4\u3002<\/p>\n<p style=\"color: #000000;\"><strong>\u4f7f\u7528\u6dd8\u5b9d\u955c\u50cf<\/strong><\/p>\n<p style=\"color: #000000;\">\u6dd8\u5b9d\u955c\u50cf\u5b98\u7f51\u662f<a style=\"color: #006699;\" href=\"https:\/\/npm.taobao.org\/\" target=\"_blank\" rel=\"nofollow\">https:\/\/npm.taobao.org\/<\/a><\/p>\n<p style=\"color: #000000;\">\u4f7f\u7528\u6dd8\u5b9d\u955c\u50cf\u524d\u8bf7\u81ea\u884c\u5b89\u88c5\u597d npm \u548c node<\/p>\n<p style=\"color: #000000;\"><span style=\"color: #3366ff;\"><strong>node \u548c npm \u7684\u5b89\u88c5<\/strong><\/span><\/p>\n<p style=\"color: #000000;\">node\u53ef\u4ee5\u5728<a style=\"color: #006699;\" href=\"https:\/\/npm.taobao.org\/mirrors\/node\" target=\"_blank\" rel=\"nofollow\">\u8fd9\u91cc<\/a>\u4e0b\u8f7d<\/p>\n<p style=\"color: #000000;\">\u672c\u6587\u4f7f\u7528\u7684\u662f\u5b98\u65b9\u63a8\u8350v4.4.4\u957f\u671f\u652f\u6301\u7248<\/p>\n<p style=\"color: #000000;\"><strong>\u4e0b\u8f7d\u5e76\u89e3\u538b node-v4.4.4-Linux-x64.tar.xz\u00a0<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_478088\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">tar<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">-xJf node-v4.4.4-linux-x64.<\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">tar<\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">.xz<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u79fb\u5230\u901a\u7528\u7684\u8f6f\u4ef6\u5b89\u88c5\u76ee\u5f55 \/opt\/\u00a0<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_663372\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">sudo<\/code> <code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">mv<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">node-v4.4.4-linux-x64 <\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/opt\/<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u5b89\u88c5 npm \u548c node \u547d\u4ee4\u5230\u7cfb\u7edf\u547d\u4ee4<br \/>\n<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_865168\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-style: normal !important;\">2<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">sudo<\/code> <code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">ln<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">-s <\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/opt\/node-v4<\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">.4.4-linux-x64<\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/bin\/node<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/usr\/local\/bin\/node<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-style: normal !important;\"><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">sudo<\/code> <code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">ln<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">-s <\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/opt\/node-v4<\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">.4.4-linux-x64<\/code><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/bin\/npm<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\/usr\/local\/bin\/npm<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u9a8c\u8bc1\uff1a<br \/>\n<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_201023\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">node -<\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">v<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">v4.4.4<\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_51488\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">npm -<\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">v<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\">2.15.1<\/p>\n<p style=\"color: #000000;\"><span style=\"color: #3366ff;\"><strong>\u8bbe\u7f6e npm \u4f7f\u7528\u6dd8\u5b9d\u6e90<\/strong><\/span><\/p>\n<p style=\"color: #000000;\">\u5728\u00a0<code style=\"color: #c7254e;\">~\/.bashrc\u00a0<\/code>\u4e2d\u6dfb\u52a0\uff08\u8bf7\u5148\u5907\u4efd\u00a0<code style=\"color: #c7254e;\">cp ~\/.bashrc ~\/.bashrc.bak<\/code>\uff09<\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_195012\" class=\"syntaxhighlighter  xhtml\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-style: normal !important;\">2<\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-style: normal !important;\">3<\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-style: normal !important;\">4<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"xhtml plain\" style=\"font-style: normal !important; color: black !important;\">alias cnpm=\"npm --registry=<a style=\"font-style: normal !important; color: #006699;\" href=\"https:\/\/registry.npm.taobao.org\/\">https:\/\/registry.npm.taobao.org<\/a> \\<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-style: normal !important;\"><code class=\"xhtml plain\" style=\"font-style: normal !important; color: black !important;\">--cache=$HOME\/.npm\/.cache\/cnpm \\<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-style: normal !important;\"><code class=\"xhtml plain\" style=\"font-style: normal !important; color: black !important;\">--disturl=<a style=\"font-style: normal !important; color: #006699;\" href=\"https:\/\/npm.taobao.org\/dist\">https:\/\/npm.taobao.org\/dist<\/a> \\<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-style: normal !important;\"><code class=\"xhtml plain\" style=\"font-style: normal !important; color: black !important;\">--userconfig=$HOME\/.cnpmrc\"<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u4f7f\u4fee\u6539\u7acb\u5373\u751f\u6548\uff0c\u8f93\u5165\uff0c\u56de\u8f66\u00a0<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_229255\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">source<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">~\/.bashrc<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><span style=\"color: #3366ff;\"><strong>\u4f7f\u7528\u6dd8\u5b9d\u955c\u50cf\u5b89\u88c5 npm \u5305<\/strong><\/span><\/p>\n<p style=\"color: #000000;\"><strong>\u7ec8\u7aef\u8f93\u5165<br \/>\n<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_180388\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">cnpm <\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">install<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">[name]<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><span style=\"color: #ff0000;\"><strong>\u9644\u5f55A &#8211; npm\u547d\u4ee4<\/strong><\/span><\/p>\n<p style=\"color: #000000;\"><strong>\u5168\u5c40\u5b89\u88c5<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_101042\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">npm <\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">install<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">-g \u8f6f\u4ef6\u5305\u540d<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u5168\u5c40\u5b89\u88c5\u7684\u8def\u5f84\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_450586\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">npm config get prefix<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u5168\u5c40\u5b89\u88c5\u7684\u8def\u5f84\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_424209\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">npm config <\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">set<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">prefix <\/code><code class=\"bash string\" style=\"font-style: normal !important; color: blue !important;\">\"\u76ee\u5f55\"<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><strong>\u5c40\u90e8\u5b89\u88c5\uff08\u5c06\u6a21\u5757\u4e0b\u8f7d\u5230\u5f53\u524d\u547d\u4ee4\u884c\u6240\u5728\u76ee\u5f55\uff09\uff0c\u4e0d\u63a8\u8350<\/strong><\/p>\n<div class=\"jb51code\" style=\"color: #000000;\">\n<div>\n<div id=\"highlighter_624813\" class=\"syntaxhighlighter  bash\">\n<div class=\"toolbar\" style=\"font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-style: normal !important; color: #006699;\" href=\"http:\/\/www.jb51.net\/article\/95114.htm#\">?<\/a><\/div>\n<table style=\"font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-style: normal !important;\">\n<tr style=\"font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\">1<\/div>\n<\/td>\n<td class=\"code\" style=\"font-style: normal !important;\">\n<div class=\"container\" style=\"font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-style: normal !important;\"><code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">npm <\/code><code class=\"bash functions\" style=\"font-style: normal !important; color: #ff1493 !important;\">install<\/code> <code class=\"bash plain\" style=\"font-style: normal !important; color: black !important;\">\u8f6f\u4ef6\u5305\u540d<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"color: #000000;\"><span style=\"color: #ff0000;\"><strong>\u603b\u7ed3<\/strong><\/span><\/p>\n<p style=\"color: #000000;\">\u4ee5\u4e0a\u5c31\u662f\u5728Ubuntu 16.04 64\u4f4d\u4e2d\u642d\u5efaNode.js\u5f00\u53d1\u73af\u5883\u7684\u5168\u90e8\u5185\u5bb9\uff0c\u5e0c\u671b\u672c\u6587\u7684\u5185\u5bb9\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6216\u8005\u5de5\u4f5c\u80fd\u5e26\u6765\u4e00\u5b9a\u7684\u5e2e\u52a9\uff0c\u5982\u679c\u6709\u7591\u95ee\u5927\u5bb6\u53ef\u4ee5\u7559\u8a00\u4ea4\u6d41\u3002<\/p>\n<p style=\"color: #000000;\"><a href=\"http:\/\/www.jb51.net\/article\/95114.htm\" target=\"_blank\">http:\/\/www.jb51.net\/article\/95114.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/node.js\u7684\u5b89\u88c5\u4f9d\u8d56\u5176\u4ed6\u73af\u5883\uff0c\u9996\u5148\u8981\u66f4\u65b0\u5176\u4ed6\u8f6f\u4ef6 apt-get update apt-get ins [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,39],"tags":[],"class_list":["post-5260","post","type-post","status-publish","format-standard","hentry","category-nodejs","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5260"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5260\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}