出现的错误是:
yangyan-mac-pro:~ yangyan$ npm search grunt npm WARN search fast search endpoint errored. Using old search. npm WARN Failed to read search cache. Rebuilding npm WARN Building the local index for the first time, please be patient npm ERR! Darwin 16.5.0 npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "search" "grunt" npm ERR! node v7.9.0 npm ERR! npm v4.2.0 npm ERR! No search sources available npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! /Users/yangyan/.npm/_logs/2017-04-23T07_26_56_966Z-debug.log
网上说是因为使用了阿里云的npm注册点导致的,目前还不知道什么问题,有可能是阿里云的registry不支持新版本的npm?
修改配置文件 `/usr/local/etc/npmrc` 为使用官方的registry后正常:
registry=https://registry.npmjs.org/
了解 工作生活心情记忆 的更多信息
订阅后即可通过电子邮件收到最新文章。