【发布时间】:2014-01-25 23:20:00
【问题描述】:
我正在尝试为我喜欢的 NPM 包创建一个修复程序,Wintersmith。但是,Wintersmith 应该是全局安装的(可以使用 wintersmith <command> 执行),我似乎无法从项目的根目录运行它,我使用 git clone <my fork url> 在本地手动安装了它,而没有收到类似 node ./node_modules/wintersmith/bin/wintersmith 的东西路径错误:
module.js:340
throw err;
^
Error: Cannot find module '../lib/cli/'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (F:\web\wintersmith\node_modules\bin\wintersmith:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
我认为正确开发和测试此功能的唯一方法是手动将全局安装的 Wintersmith 包替换为我的分叉版本,然后使用该版本执行命令以测试我的更改是否有效。
在使用/开发全局 NPM 包时,我是否缺少某些工作流程步骤?
【问题讨论】:
标签: javascript node.js npm