Node.js的基本操作(使用Vue前必学)

时间:2023-03-10 02:55:20
Node.js的基本操作(使用Vue前必学)

安装

Windows下不需要讲,Mac下的安装步骤:
https://www.cnblogs.com/bobi1234/category/1367458.html

全局安装淘宝镜像

npm install cnpm -g --registry=https://registry.npm.taobao.org
cnpm -v

可以这样做:

npm config get registry
cnpm config get registry

npm的源地址为:https://registry.npmjs.org
建议不要用 cnpm 安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题!

npm config set registry https://registry.npm.taobao.org

注意:Mac下需要加上sudo权限!

全局安装后的路径

Windows

C:\Users\Administrator\AppData\Roaming\npm\node_modules

Mac

/usr/local/lib/node_modules

注意:使用npm root -g目录可以看到全局安装路径!

Node.js的基本操作(使用Vue前必学)