在命令行中输入以下命令: npm config set registry https://registry.npmjs.org/ 等待命令行提示修改成功。 使用 npm install 命令时,就会自动使用官方源进行下载。