Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

npm --registry=http://registry.cnpmjs.org 有坑 #103

Closed
alsotang opened this issue Dec 18, 2013 · 3 comments
Closed

npm --registry=http://registry.cnpmjs.org 有坑 #103

alsotang opened this issue Dec 18, 2013 · 3 comments
Assignees
Milestone

Comments

@alsotang
Copy link
Member

当我使用这句话装包的时候(npm --registry=http://registry.cnpmjs.org i express),返回 401。
相关代码在
qq20131218-2

由于我是 npm login 过的,所以我的请求自带 http basic auth 的头,于是在这一步被强迫验证从而被返回 401。


当使用 cnpm 的时候就可以成功安装包。因为 cnpm 默认使用空白的 .cnpmrc 文件,覆盖了 npm 原生的 auth 信息。
qq20131218-4

@alsotang
Copy link
Member Author

这句话 alias cnpm="npm --registry=http://registry.cnpmjs.org --cache=$HOME/.npm/.cache/cnpm"

我觉得应该从以下配置琢磨琢磨到底带哪些参数。

var config = module.exports = {
  cnpmHost: 'http://cnpmjs.org',
  cnpmRegistry: 'http://registry.cnpmjs.org',
  disturl: 'http://dist.u.qiniudn.com', // download dist tarball for node-gyp
  cache: path.join(root, '.npm/.cache/cnpm'),  //cache folder name
  userconfig: path.join(root, '.cnpmrc')
};

@dead-horse
Copy link
Member

�还要加userconfig

@fengmk2
Copy link
Member

fengmk2 commented Dec 18, 2013

可以将文档修改一下

@ghost ghost assigned dead-horse Dec 18, 2013
fengmk2 added a commit that referenced this issue Dec 19, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants