如何导入nib模块与范围从github安装的名称?

我试图用npm安装一个github项目的分支(因为我想对其进行开发,所以不需要任何特定的提交):

% npm install parkan/graffiti-mongoose @risingstack/graffiti-mongoose@2.0.0 node_modules/@risingstack/graffiti-mongoose 

这似乎是查找父回购,并安装它对我的呃主版本,到目前为止好。 请注意,该包使用范围包名称语义 ,我认为这是问题的一部分。

 % npm list |grep mongoose ├── @risingstack/graffiti-mongoose@2.0.0 (git://github.com/parkan/graffiti-mongoose.git#01a8480fa7d787a4d74bf3bcb257d01b4d73129a) % ls node_modules/@risingstack/graffiti-mongoose CHANGELOG.md LICENSE fixture CONTRIBUTING.md README.md package.json 

但是,我无法获取节点导入或以任何明显的方式要求:

 > require('graffiti-mongoose'); Error: Cannot find module 'graffiti-mongoose' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at repl:3:1 at Object.exports.runInThisContext (vm.js:54:17) at _eval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:86:26) at REPLServer.replEval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:169:14) at bound (domain.js:250:14) at REPLServer.runBound [as eval] (domain.js:263:12) > require('@risingstack/graffiti-mongoose'); Error: Cannot find module '@risingstack/graffiti-mongoose' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at repl:3:1 at Object.exports.runInThisContext (vm.js:54:17) at _eval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:86:26) at REPLServer.replEval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:169:14) at bound (domain.js:250:14) at REPLServer.runBound [as eval] (domain.js:263:12) > require('risingstack/graffiti-mongoose'); Error: Cannot find module 'risingstack/graffiti-mongoose' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at repl:3:1 at Object.exports.runInThisContext (vm.js:54:17) at _eval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:86:26) at REPLServer.replEval (/usr/local/lib/node_modules/babel/lib/_babel-node.js:169:14) at bound (domain.js:250:14) at REPLServer.runBound [as eval] (domain.js:263:12) 

我如何需要这样的子目录内的包?

这似乎是一个错误在NPM。 检出回购和从本地文件系统安装工作正常。

问题提交: https : //github.com/npm/npm/issues/9798

编辑:这似乎是从github安装的情况下,工件没有签入的情况下和预发布脚本必须运行之前,该模块是可用的限制,请参阅https://github.com/npm/npm/issues/3055

我添加到我的package.json中:

  "some_github_package": "git+https://github.com/user_name/package_name.git", 

然后运行npm install,你会得到它