{"id":6196,"date":"2014-08-29T11:56:17","date_gmt":"2014-08-29T03:56:17","guid":{"rendered":"http:\/\/jpuyy.com\/?p=6196"},"modified":"2020-02-02T22:48:35","modified_gmt":"2020-02-02T14:48:35","slug":"npm-command","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=6196","title":{"rendered":"npm-nodejs\u5305\u7ba1\u7406\u5668"},"content":{"rendered":"<p>npm &#8212; node package manager<\/p>\n<p>\u5168\u5c40\u5b89\u88c5nodejs\u5305<\/p>\n<pre>npm -g install net-ping<\/pre>\n<p>\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684nodejs\u5e94\u7528<\/p>\n<pre>npm ls -g installed<\/pre>\n<p>\u521b\u5efa\u9879\u76ee\u8fc7\u7a0b\uff0c\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55 mvc-express \uff0c\u8fdb\u5165\u540e\u8f93\u5165<\/p>\n<pre> npm init<\/pre>\n<p>\u56de\u7b54\u4e00\u4e9b\u95ee\u9898\u521b\u5efa\u9879\u76ee<\/p>\n<pre>This utility will walk you through creating a package.json file.\nIt only covers the most common items, and tries to guess sane defaults.\n\nSee `npm help json` for definitive documentation on these fields\nand exactly what they do.\n\nUse `npm install <pkg> --save` afterwards to install a package and\nsave it as a dependency in the package.json file.\n\nPress ^C at any time to quit.\nname: (mvc-express) \nversion: (0.0.0) 0.0.1\ndescription: my try of express\nentry point: (app.js) \ntest command: npm test\ngit repository: \nkeywords: \nauthor: jpuyy\nlicense: (ISC) \nAbout to write to \/private\/var\/forge\/node\/mvc-express\/package.json:\n\n{\n  \"name\": \"mvc-express\",\n  \"version\": \"0.0.1\",\n  \"description\": \"my try of express\",\n  \"main\": \"app.js\",\n  \"scripts\": {\n    \"test\": \"npm test\"\n  },\n  \"author\": \"jpuyy\",\n  \"license\": \"ISC\"\n}\n\n\nIs this ok? (yes) yes\n<\/pkg><\/pre>\n<p>\u63a5\u4e0b\u6765\u6211\u8981\u5b89\u88c5\u4e00\u4e9b\u5305\u65f6\uff0c\u4f7f\u7528 npm install <pkg> &#8211;save \uff0c\u4f1a\u81ea\u52a8\u52a0\u5165\u5230 package.json \u4e2d<\/pkg>\n<pre>npm install express --save<\/pre>\n<p>\u6e05\u7406\u7f13\u5b58<br \/>\nnpm cache clean<\/p>\n<p>\u68c0\u67e5<br \/>\nnpm audit fix<\/p>\n","protected":false},"excerpt":{"rendered":"<p>npm &#8212; node package manager \u5168\u5c40\u5b89\u88c5nodejs\u5305 npm -g install net-ping \u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684nodejs\u5e94\u7528 npm ls -g installed \u521b\u5efa\u9879\u76ee\u8fc7\u7a0b\uff0c\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55 mvc-express \uff0c\u8fdb\u5165\u540e\u8f93\u5165 npm init \u56de\u7b54\u4e00\u4e9b\u95ee\u9898\u521b\u5efa\u9879\u76ee This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sane defaults. See `npm help json` for definitive documentation on these fields and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-6196","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6196"}],"version-history":[{"count":12,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6196\/revisions"}],"predecessor-version":[{"id":8701,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/6196\/revisions\/8701"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}