From 4821aff69eb9d6d79937b0a8e03eec8835faa29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Tue, 12 May 2015 00:06:03 +0200 Subject: [PATCH] fix(npm-info): correctly encode scoped package names This adds support for releasing scoped packages that are public and and that have an initial version in the registry available. More fixes needed to support yet unpublished/private scoped modules. --- lib/npm-info.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/npm-info.js b/lib/npm-info.js index 50ee4450..a773b3a7 100644 --- a/lib/npm-info.js +++ b/lib/npm-info.js @@ -5,7 +5,8 @@ var request = require('request') var efh = require('./error').efh module.exports = function (pkgName, cb) { - request(process.env.npm_config_registry + pkgName, efh(cb)(function (response, body) { + var encodedPkgName = pkgName.replace(/\//g, '%2F') + request(process.env.npm_config_registry + encodedPkgName, efh(cb)(function (response, body) { var res = { version: null, gitHead: null,