- 從Node.JS的官方下載node套件
- 點開node-v8.11.2.pkg(建議選LTS版本)
- Node.js v8.11.2 to /usr/local/bin/node
- npm v5.6.0 to /usr/local/bin/npm
- node:Server-side JavaScript runtime,讓機器可以跑JavaScript
- npm:Node.js的套件管理器,安裝JavaScript寫好的套件
例如說在Mac上要安裝gitbook這個指令,可以用npm來安裝
- sudo npm install -g gitbook
[fsevents] Success: "/usr/local/lib/node_modules/gitbook/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
+ gitbook@3.2.3 - sudo npm install -g gitbook-cli
/usr/local/bin/gitbook -> /usr/local/lib/node_modules/gitbook-cli/bin/gitbook.js
+ gitbook-cli@2.3.2 - which gitbook
/usr/local/bin/gitbook - file /usr/local/bin/gitbook
/usr/local/bin/gitbook: a /usr/bin/env node script text executable, ASCII text - gitbook -V
CLI version: 2.3.2
GitBook version: 3.2.3
_EOF_
沒有留言:
張貼留言