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