【发布时间】:2016-09-30 19:12:13
【问题描述】:
我开发了一个小应用程序。
我这样做是为了在全球范围内安装开发的模块:
npm install . -g
我收到了这样的回复:
$ npm install -g .
update-deps-dev@1.0.0 C:\Users\Vladislav.Sharikov\AppData\Roaming\npm\node_modul
es\update-deps-dev
我的模块就位,其他全局安装的模块都存储在其中。此外,我的模块可通过以下方式获得:
npm ls -g --depth=0
现在,我想从我电脑上的任何地方启动这个模块。我该怎么做?
我尝试运行,但得到了这个:
Vladislav.Sharikov@PC /D/Dev
$ update-deps-dev
sh: update-deps-dev: command not found
我正在使用 Windows 7 x64 + Git Bash。
我应该如何启动我的全局安装的节点应用程序?
我的package.json 文件内容:
{
"name": "update-deps-dev",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"adm-zip": "^0.4.7",
"fs": "0.0.2",
"https": "^1.0.0",
"q": "^1.4.1",
"shelljs": "^0.7.0"
}
}
【问题讨论】:
-
看起来您还没有在包文件中定义 bin 字段。可以发一下吗?
-
是的,没有指定。我会尽快发布 package.json。可能有一些文章节点应用程序(节点包/节点模块)必须有什么以及为什么?