试图创build一个全局的npm模块。 当执行我的命令我得到“系统找不到指定的path”

我想转换一个我创build的全局使用的npm模块。 https://github.com/toymachiner62/node-mongo-seeds/tree/global

当我运行$ seed ,它给出了错误The system cannot find the path specified所以它知道这是一个全局命令。

我不知道从哪里开始debugging。 我有我的脚本console.logs和他们都没有射击,所以问题在别处,但我不知道接下来要尝试什么。

build议吗?

编辑

我现在在我的Mac上,我把种子节点的shebangpath改为#!/usr/local/bin node

尝试使用我的模块时,仍然出现这些错误:

 $ seed -bash: /usr/local/bin/seed: /usr/local/bin: bad interpreter: Permission denied $ sudo seed sudo: unable to execute /usr/local/bin/seed: Permission denied 

编辑

看来这只是我的一个电脑上的一个问题。 另一个工作得很好..

你应该命名脚本bin / seed.js并像这样调用它。 另外,节点的path在bin / seed的顶部似乎不正确。