{"id":29587,"date":"2025-04-20T11:06:07","date_gmt":"2025-04-20T03:06:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/29587.html"},"modified":"2025-04-20T11:06:07","modified_gmt":"2025-04-20T03:06:07","slug":"freebsd%e4%b8%8b%e5%ae%89%e8%a3%85npm-node-js%e7%9a%8422%e7%89%88%e6%9c%ac-%e5%b9%b6%e7%ae%80%e5%8d%95%e6%b5%8b%e8%af%95js%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/29587.html","title":{"rendered":"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668"},"content":{"rendered":"<h2>FreeBSD\u4e0b\u5b89\u88c5Node.js<\/h2>\n<p>\u5728FreeBSD\u4e0b\u5b89\u88c5Node.js\u5f88\u65b9\u4fbf&#xff0c;\u76f4\u63a5pkg\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p>\u4f7f\u7528pkg install\u5b89\u88c5npm<\/p>\n<p>sudo pkg install npm-node22<br \/>\nUpdating FreeBSD repository catalogue&#8230;<br \/>\nFetching data.pkg: 100%    7 MiB   2.5MB\/s    00:03<br \/>\nProcessing entries: 100%<br \/>\nFreeBSD repository update completed. 35884 packages processed.<br \/>\nAll repositories are up to date.<br \/>\nThe following 3 package(s) will be affected (of 0 checked):<\/p>\n<p>New packages to be INSTALLED:<br \/>\n        gmake: 4.4.1<br \/>\n        node22: 22.13.1<br \/>\n        npm-node22: 10.9.2<\/p>\n<p>Number of packages to be installed: 3<\/p>\n<p>The process will require 76 MiB more space.<br \/>\n16 MiB to be downloaded. <\/p>\n<h2>\u5efa\u7acbjs\u670d\u52a1\u5668<\/h2>\n<h3>\u521b\u5efa\u670d\u52a1\u5668\u76ee\u5f55<\/h3>\n<p>mkdir jsserver<br \/>\ncd jsserver\/ <\/p>\n<h3>\u521d\u59cb\u5316\u9879\u76ee<\/h3>\n<p>npm init -y<\/p>\n<p>\u8f93\u51fa&#xff1a;\u00a0<\/p>\n<p>npm init -y<br \/>\nWrote to \/home\/skywalk\/work\/jsserver\/package.json:<\/p>\n<p>{<br \/>\n  &#034;name&#034;: &#034;jsserver&#034;,<br \/>\n  &#034;version&#034;: &#034;1.0.0&#034;,<br \/>\n  &#034;main&#034;: &#034;index.js&#034;,<br \/>\n  &#034;scripts&#034;: {<br \/>\n    &#034;test&#034;: &#034;echo \\\\&#034;Error: no test specified\\\\&#034; &amp;&amp; exit 1&#034;<br \/>\n  },<br \/>\n  &#034;keywords&#034;: [],<br \/>\n  &#034;author&#034;: &#034;&#034;,<br \/>\n  &#034;license&#034;: &#034;ISC&#034;,<br \/>\n  &#034;description&#034;: &#034;&#034;<br \/>\n}<\/p>\n<h3 style=\"background-color:transparent\">\u5b89\u88c5\u4f9d\u8d56\u5e93<\/h3>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528 Express.js \u6765\u5feb\u901f\u6784\u5efa Web \u670d\u52a1\u5668\u3002\u5b89\u88c5 Express \u548c\u5176\u4ed6\u5fc5\u8981\u7684\u5e93&#xff1a;<\/p>\n<p>npm install express body-parser cors <\/p>\n<h3 style=\"background-color:transparent\">\u00a0\u521b\u5efa\u670d\u52a1\u5668\u4ee3\u7801server.js<\/h3>\n<p> \u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a server.js \u7684\u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p>\/\/ server.js<br \/>\nconst express &#061; require(&#039;express&#039;);<br \/>\nconst bodyParser &#061; require(&#039;body-parser&#039;);<br \/>\nconst cors &#061; require(&#039;cors&#039;);<br \/>\n\u00a0<br \/>\nconst app &#061; express();<br \/>\nconst PORT &#061; process.env.PORT || 3000;<br \/>\n\u00a0<br \/>\n\/\/ \u4e2d\u95f4\u4ef6<br \/>\napp.use(cors());<br \/>\napp.use(bodyParser.json());<br \/>\n\u00a0<br \/>\n\/\/ \u6a21\u62df AI \u54cd\u5e94<br \/>\napp.post(&#039;\/api\/chat&#039;, (req, res) &#061;&gt; {<br \/>\n\u00a0 \u00a0 const userInput &#061; req.body.question;<br \/>\n\u00a0 \u00a0\u00a0<br \/>\n\u00a0 \u00a0 \/\/ \u8fd9\u91cc\u53ef\u4ee5\u6dfb\u52a0 AI \u903b\u8f91&#xff0c;\u5f53\u524d\u53ea\u662f\u8fd4\u56de\u4e00\u4e2a\u56fa\u5b9a\u7684\u54cd\u5e94<br \/>\n\u00a0 \u00a0 const response &#061; &#096;You asked: &#034;${userInput}&#034;. This is a simulated response.&#096;;<br \/>\n\u00a0 \u00a0\u00a0<br \/>\n\u00a0 \u00a0 res.json({ response });<br \/>\n});<br \/>\n\u00a0<br \/>\n\/\/ \u542f\u52a8\u670d\u52a1\u5668<br \/>\napp.listen(PORT, () &#061;&gt; {<br \/>\n\u00a0 \u00a0 console.log(&#096;Server is running on http:\/\/localhost:${PORT}&#096;);<br \/>\n});<\/p>\n<h3 style=\"background-color:transparent\">\u521b\u5efa JavaScript \u5e93puter.js<\/h3>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u5e76\u4e0d\u662f\u5fc5\u987b\u653e\u5728\u5f53\u524d\u670d\u52a1\u5668\u7684&#xff0c;\u53ef\u4ee5\u653e\u5728\u5176\u5b83\u670d\u52a1\u5668\u6216\u8005\u6d4b\u8bd5index.html\u7f51\u9875\u7684\u76f8\u540c\u76ee\u5f55\u3002 \u8fd9\u91cc\u4e3a\u4e86\u4ee3\u7801\u7ba1\u7406\u65b9\u4fbf&#xff0c;\u4e5f\u540c\u65f6\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a puter.js \u7684\u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p>\/\/ puter.js<br \/>\nconst puter &#061; {<br \/>\n\u00a0 \u00a0 ai: {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 chat: function(question) {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return fetch(&#039;http:\/\/localhost:3000\/api\/chat&#039;, {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 method: &#039;POST&#039;,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 headers: {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#039;Content-Type&#039;: &#039;application\/json&#039;<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 },<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 body: JSON.stringify({ question })<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }).then(response &#061;&gt; response.json());<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 }<br \/>\n\u00a0 \u00a0 },<br \/>\n\u00a0 \u00a0 print: function(data) {<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 console.log(data.response);<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 alert(data.response); \/\/ \u4e5f\u53ef\u4ee5\u7528 alert \u663e\u793a\u54cd\u5e94<br \/>\n\u00a0 \u00a0 }<br \/>\n};<br \/>\n\u00a0<br \/>\n\/\/ \u5c06 puter \u5bf9\u8c61\u66b4\u9732\u5230\u5168\u5c40<br \/>\nwindow.puter &#061; puter; <\/p>\n<h3 style=\"background-color:transparent\">\u542f\u52a8\u670d\u52a1<\/h3>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u670d\u52a1<\/p>\n<p>node server.js<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u8f93\u51fa&#xff1a;Server is running on http:\/\/localhost:3000<\/p>\n<p>\u670d\u52a1\u5668\u542f\u52a8\u4e86\u3002<\/p>\n<h3 style=\"background-color:transparent\">\u521b\u5efa\u524d\u7aef HTML \u6587\u4ef6<\/h3>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u5e76\u4e0d\u662f\u5fc5\u987b\u653e\u5728\u5f53\u524d\u670d\u52a1\u5668\u7684&#xff0c;\u53ef\u4ee5\u653e\u5728\u5176\u5b83\u670d\u52a1\u5668\u6216\u8005\u6d4b\u8bd5puter.js\u7684\u76f8\u540c\u76ee\u5f55\u3002 \u8fd9\u91cc\u4e3a\u4e86\u4ee3\u7801\u7ba1\u7406\u65b9\u4fbf&#xff0c;\u4e5f\u540c\u65f6\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a index.html \u7684\u6587\u4ef6&#xff0c;\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801&#xff1a;<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n\u00a0 \u00a0 &lt;meta charset&#061;&#034;UTF-8&#034;&gt;<br \/>\n\u00a0 \u00a0 &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n\u00a0 \u00a0 &lt;title&gt;AI Chat Example&lt;\/title&gt;<br \/>\n\u00a0 \u00a0 &lt;script src&#061;&#034;puter.js&#034;&gt;&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n\u00a0 \u00a0 &lt;script&gt;<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 puter.ai.chat(&#096;\u4f60\u597d&#xff01; AI&#xff01;&#096;).then(data &#061;&gt; puter.print(data));<br \/>\n\u00a0 \u00a0 &lt;\/script&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt; <\/p>\n<h2>\u6d4b\u8bd5<\/h2>\n<h3>\u5148\u7528curl\u6d4b\u8bd5\u670d\u52a1\u5668<\/h3>\n<p>curl -X POST http:\/\/localhost:3000\/api\/chat \\\\<br \/>\n-H &#034;Content-Type: application\/json&#034; \\\\<br \/>\n-d &#039;{<br \/>\n    &#034;question&#034;: &#034;\u4f60\u80fd\u544a\u8bc9\u6211\u4eca\u5929\u7684\u5929\u6c14\u5417&#xff1f;&#034;<br \/>\n}&#039;<\/p>\n<p>\u56de\u590d<\/p>\n<p>{&#034;response&#034;:&#034;You asked: \\\\&#034;\u4f60\u80fd\u544a\u8bc9\u6211\u4eca\u5929\u7684\u5929\u6c14\u5417&#xff1f;\\\\&#034;. This is a simulated response.&#034;} <\/p>\n<p>\u8bc1\u660ejs\u670d\u52a1\u5668\u662fok\u7684\u3002\u00a0<\/p>\n<h3>\u6574\u4f53\u6d4b\u8bd5<\/h3>\n<p>\u5728\u540c\u4e00\u76ee\u5f55\u653e\u7f6eindex.html\u548cputer.js\u6587\u4ef6&#xff0c;\u7136\u540e\u7528\u6d4f\u89c8\u5668\u76f4\u63a5\u6253\u5f00\u8fd9\u4e2aindex.html\u6587\u4ef6&#xff0c;\u4f1a\u663e\u793a\u5f39\u51fa\u4fe1\u606f&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420030606-6804649e6787d.png\" \/>\u00a0<\/p>\n<p>\u8bc1\u660eindex.html\u6587\u4ef6\u91cc\u7684puter.js\u8fd9\u4e2ajs\u811a\u672c\u8d77\u4f5c\u7528\u4e86\u3002 \u53ef\u4ee5\u770b\u5230index.html\u6587\u4ef6\u4e2d\u662f\u6ca1\u6709\u5199http:\/\/localhost:3000\/api\/chat\u00a0\u8fd9\u4e2a\u5730\u5740\u7684&#xff0c;\u5b83\u8c03\u7528\u4e86puter.js\u6587\u4ef6&#xff0c;\u5e76\u4f7f\u7528\u4e86\u8fd9\u53e5\u8bddputer.ai.chat(&#096;\u4f60\u597d&#xff01; AI&#xff01;&#096;).then(data &#061;&gt; puter.print(data)); \u6765\u8c03\u7528\u4e86puter.ai.chat\u7684\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p>\u606d\u559c\u6d4b\u8bd5\u901a\u8fc7&#xff01;<\/p>\n<p>\u4ee5\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u642d\u5efa\u4e00\u53f0\u81ea\u5df1\u7684js\u670d\u52a1\u5668\u6765\u67b6\u8bbeAI\u670d\u52a1\u5566&#xff01;<\/p>\n<h2>\u8fdb\u4e00\u6b65\u601d\u8003api\u79d8\u94a5\u95ee\u9898<\/h2>\n<p>\u5728\u4f7f\u7528\u00a0puter.js\u00a0\u6216\u4efb\u4f55\u524d\u7aef JavaScript \u4ee3\u7801\u8c03\u7528 OpenAI \u7684 API \u65f6&#xff0c;\u4fdd\u62a4 API \u5bc6\u94a5\u662f\u975e\u5e38\u91cd\u8981\u7684&#xff0c;\u56e0\u4e3a\u5c06\u5bc6\u94a5\u76f4\u63a5\u5d4c\u5165\u5230\u524d\u7aef\u4ee3\u7801\u4e2d\u4f1a\u5bfc\u81f4\u5bc6\u94a5\u66b4\u9732&#xff0c;\u53ef\u80fd\u88ab\u6076\u610f\u7528\u6237\u6ee5\u7528\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4fdd\u62a4 API \u5bc6\u94a5\u7684\u6700\u4f73\u5b9e\u8df5&#xff1a;<\/p>\n<h4>1. \u4f7f\u7528\u540e\u7aef\u4ee3\u7406<\/h4>\n<p>\u6700\u5b89\u5168\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u540e\u7aef\u670d\u52a1\u5668\u6765\u4ee3\u7406\u8bf7\u6c42\u3002\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u540e\u7aef API&#xff0c;\u524d\u7aef\u4ee3\u7801\u53ea\u4e0e\u8fd9\u4e2a\u540e\u7aef API \u4ea4\u4e92&#xff0c;\u800c\u540e\u7aef API \u518d\u4e0e OpenAI \u7684 API \u8fdb\u884c\u901a\u4fe1\u3002\u8fd9\u6837&#xff0c;API \u5bc6\u94a5\u53ea\u5b58\u50a8\u5728\u540e\u7aef&#xff0c;\u4e0d\u4f1a\u66b4\u9732\u7ed9\u524d\u7aef\u3002<\/p>\n<h4>2. \u4f7f\u7528\u73af\u5883\u53d8\u91cf<\/h4>\n<p>\u5728\u540e\u7aef\u4ee3\u7801\u4e2d&#xff0c;\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u6765\u5b58\u50a8 API \u5bc6\u94a5&#xff0c;\u800c\u4e0d\u662f\u786c\u7f16\u7801\u5728\u4ee3\u7801\u4e2d\u3002\u53ef\u4ee5\u4f7f\u7528\u00a0.env\u00a0\u6587\u4ef6\u548c\u00a0dotenv\u00a0\u5305\u6765\u52a0\u8f7d\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<h4>3. \u9650\u5236 API \u5bc6\u94a5\u7684\u6743\u9650<\/h4>\n<p>\u4f8b\u5982&#xff0c;\u8bbe\u7f6e IP \u767d\u540d\u5355\u6216\u9650\u5236\u8bf7\u6c42\u7684\u901f\u7387&#xff0c;\u4ee5\u51cf\u5c11\u6f5c\u5728\u7684\u6ee5\u7528\u98ce\u9669\u3002<\/p>\n<p>\u6bd4\u5982puter\u5b98\u65b9\u7684js AI\u5e93&#xff0c;\u5c31\u662f\u9650\u5b9a\u5b83\u7684\u516c\u6709\u4e91\u670d\u52a1\u5668\u53ef\u4ee5\u8c03\u7528&#xff0c;\u7528\u6237\u81ea\u5df1\u642d\u5efa\u7684\u79c1\u6709\u670d\u52a1\u5668\u4e0d\u53ef\u4ee5\u8c03\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb726\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5148FreeBSD\u4e0b\u5b89\u88c5Node.js\u5f88\u65b9\u4fbf\uff0c\u76f4\u63a5pkg\u5b89\u88c5\u5373\u53ef\u3002\u76f4\u63a5pkg install\u5b89\u88c5\u3002_node22<\/p>\n","protected":false},"author":2,"featured_media":29586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,186,50,43,1281],"topic":[],"class_list":["post-29587","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-javascript","tag-node-js","tag-50","tag-43","tag-1281"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/29587.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb726\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5148FreeBSD\u4e0b\u5b89\u88c5Node.js\u5f88\u65b9\u4fbf\uff0c\u76f4\u63a5pkg\u5b89\u88c5\u5373\u53ef\u3002\u76f4\u63a5pkg install\u5b89\u88c5\u3002_node22\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/29587.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-20T03:06:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420030606-6804649e6787d.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29587.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/29587.html\",\"name\":\"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-20T03:06:07+00:00\",\"dateModified\":\"2025-04-20T03:06:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/29587.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/29587.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/29587.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/29587.html","og_locale":"zh_CN","og_type":"article","og_title":"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb726\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u5148FreeBSD\u4e0b\u5b89\u88c5Node.js\u5f88\u65b9\u4fbf\uff0c\u76f4\u63a5pkg\u5b89\u88c5\u5373\u53ef\u3002\u76f4\u63a5pkg install\u5b89\u88c5\u3002_node22","og_url":"https:\/\/www.wsisp.com\/helps\/29587.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-20T03:06:07+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420030606-6804649e6787d.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/29587.html","url":"https:\/\/www.wsisp.com\/helps\/29587.html","name":"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-20T03:06:07+00:00","dateModified":"2025-04-20T03:06:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/29587.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/29587.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/29587.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"FreeBSD\u4e0b\u5b89\u88c5npm Node.js\u768422\u7248\u672c \u5e76\u7b80\u5355\u6d4b\u8bd5js\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/29587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=29587"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/29587\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/29586"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=29587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=29587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=29587"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=29587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}