使用npm安装@stripe/stripe-node时出现404错误求助
解决npm安装Stripe SDK时的404错误
问题描述
执行命令 npm install --save @stripe/stripe-node 时出现如下报错:
npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@stripe%2fstripe-node - Not found npm ERR! 404 npm ERR! 404 '@stripe/stripe-node@*' 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.
直接访问对应registry链接也返回 {"error":"Not found"},怀疑是Stripe服务器问题。
解决方案
这不是Stripe服务器的问题,你用错了包名。Stripe官方的Node.js SDK包名是stripe,而非@stripe/stripe-node,不存在的包名导致了404错误。
执行正确的安装命令即可:
npm install --save stripe
如果需要安装特定版本,可指定版本号:
npm install --save stripe@<版本号>
内容的提问来源于stack exchange,提问作者Mutti
相关产品推荐
相关产品推荐

