node.js - npm 似乎忽略了我的私有(private)模块和针对公共(public)注册表的 404

标签 node.js npm joyent

也许有人以前见过这个……我有一个私有(private)模块,我想将其包含在我的应用程序中。我在 Gemfury 上将其作为 tarball 引用,并且在库的多个版本上本地(始终如此)一切正常,但我的 Joyent 盒子上的“npm install”输出以下错误。

NPM 似乎成功地拉下了模块,然后尝试(但失败了)在注册表中查找它。

我假设我在做一些愚蠢的事情。知道它是什么吗?

注意:

我还尝试通过 package.json 中的 git URL 引用该模块。 SSH 似乎可以连接,因为它询问我是否信任 github.com 的 IP 和 RSA 指纹,但随后 NPM 再次点击注册表并获得 404。我猜这与包有关,但不能'不在本地复制。

npm http GET https://npm.fury.io/--token--/richmarr/cake-lib/-/latest.tgz
npm http 200 https://npm.fury.io/--token--/richmarr/cake-lib/-/latest.tgz
npm http GET https://registry.npmjs.org/cake-lib/0.0.10
npm http 404 https://registry.npmjs.org/cake-lib/0.0.10
npm ERR! 404 'cake-lib' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System SunOS 5.11
npm ERR! command "/opt/nodejs/v0.10.21/bin/node" "/home/node/local/nodejs/bin/npm" "install" "https://npm.fury.io/--token--/richmarr/cake-lib/-/latest.tgz"
npm ERR! cwd /home/node/node-service/releases/2013-11-27T22-18-23.324752929
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/node/node-service/releases/2013-11-27T22-18-23.324752929/npm-debug.log
npm ERR! not ok code 0

应用程序的 package.json 是这样的:

{
  "name": "application-name",
  "version": "0.0.3",
  "private": true,
  "scripts": {
    "start": "node app.js",
    "test": "mocha"
  },
  "dependencies": {
    "express": "3.2.1",
    "sizlate": "~0.8.3",
    "newrelic": "~0.11.0",
    "passport": "~0.1.17",
    "passport-twitter": "~1.0.2",
    "passport-local": "~0.1.6",
    "connect-flash": "~0.1.1",
    "passport-http": "~0.2.2",
    "helmet": "~0.1.0",
    "express-validator": "~0.8.0",
    "async": "~0.2.9",
    "cake-lib": "https://npm.fury.io/--token--/richmarr/cake-lib/-/latest.tgz"
  },
  "engines": {
    "node": "0.10.21"
  },
  "devDependencies": {
    "mocha": "~1.13.0"
  }
}

库的package.json:

{
  "name": "cake-lib",
  "version": "0.0.10",
  "private": true,
  "description": "Data & connectivity lib",
  "main": "index.js",
  "scripts": {
    "test": "mocha",
    "pub": "npm version patch; npm pack; npm run upload",
    "upload": "curl -F package=@cake-lib-$npm_package_version.tgz https://push.fury.io/--token--; rm *.tgz"
  },
  "dependencies": {
    "scrypt": "~1.7.3",
    "mysql": "~2.0.0-alpha9",
    "awssum": "~1.1.1",
    "awssum-amazon": "~1.1.1",
    "awssum-amazon-ses": "~1.0.0",
    "stripe": "~1.3.0",
    "async": "~0.2.9",
    "apn": "~1.4.2",
    "uuid": "~1.4.1"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/richmarr/cake-lib.git"
  },
  "author": "",
  "bugs": {
    "url": "https://github.com/richmarr/cake-lib/issues"
  },
  "devDependencies": {
    "mocha": "~1.13.0"
  }
}

最佳答案

这是错误默认的情况。使用 npm config 重置注册表 URL:

npm config set registry https://npm.fury.io/

关于node.js - npm 似乎忽略了我的私有(private)模块和针对公共(public)注册表的 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20263474/

相关文章:

javascript - 将 ES 模块 (.mjs) 发布到 NPMJS,向后兼容 Node <8.5.0(双包)

node.js - 来自 dokku 容器的 DNS 查找

node.js - 将 Ghost 博客作为在 Node http-server 上运行的网站的子文件夹运行

node.js - AWS Lambda 制作视频缩略图

node.js - MongooseJS - 如何找到具有最大值的元素?

javascript - 使用 javascript 的 Discord 机器人 .sendMessage 不是函数

javascript - Node 模块无法导入

node.js - 通过 package.json 安装 "global"npm 依赖项

python - 如何在 Solaris 11 上安装hiredis?