Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
1、Node官網下載pkg安裝包,點擊安裝即可,安裝包包含nodejs和npm(node package manager)
2、安裝完成之后我們關閉窗口,接下來我們打開“終端”,並且輸入命令:
curl http://npmjs.org/install.sh | sh
這個npm.js實際上是Node.js的套件管理工具,執行完成之后我們繼續執行命令,更新npm:
sudo npm update npm -g
3、查看npm是否安裝成功
npm -v