macOS系统下无法安装@nut-tree/nut-js的问题求助
macOS安装@nut-tree/nut-js遇404错误的解决方法
问题详情
在macOS系统中执行以下安装命令时均返回404错误:
yarn add @nut-tree/nut-js
sudo npm i @nut-tree/nut-js -g
具体报错信息如下:
yarn add v1.22.22 warning package.json: No license field info No lockfile found. warning No license field [1/4] 🔍 Resolving packages... error Error: https://registry.yarnpkg.com/@nut-tree%2fnut-js: Not found sudo npm i @nut-tree/nut-js -g Password: npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@nut-tree%2fnut-js - Not found npm ERR! 404 npm ERR! 404 '@nut-tree/nut-js@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.
解决步骤
切换至官方npm/yarn源
若当前使用的是非官方镜像源,可能导致包无法被检索到:- 查看并切换npm源:
npm config get registry npm config set registry https://registry.npmjs.org/ - 查看并切换yarn源:
yarn config get registry yarn config set registry https://registry.yarnpkg.com/
- 查看并切换npm源:
确认包名拼写
确保安装命令中的包名是@nut-tree/nut-js,注意符号和拼写的准确性。指定具体版本安装
尝试指定已发布的稳定版本进行安装,例如:npm install @nut-tree/nut-js@3.1.0 -gyarn add @nut-tree/nut-js@3.1.0清理缓存后重试
缓存异常也可能导致包检索失败,清理后重新安装:- npm清理缓存:
npm cache clean --force - yarn清理缓存:
yarn cache clean
- npm清理缓存:
内容的提问来源于stack exchange,提问作者NAMAN GOEL
相关产品推荐
相关产品推荐

