1

我正在尝试安装我在 Github 上找到 的Elm-d3连接器。

  • Elm是一种函数响应式编程语言 Evan Czaplicki
  • d3.js是 Michael Bostock 的流行图形元库

Elm-d3使您能够使用 HTML、SVG 和 CSS 创建类型安全、可组合的小部件。D3 充当库的概念基础,以及 Elm 的替代渲染器。


前两个安装说明是:

npm install smash
make

安装粉碎顺利(虽然我必须使用sudo

npm http GET https://registry.npmjs.org/smash
npm http 304 https://registry.npmjs.org/smash
npm http GET https://registry.npmjs.org/queue-async
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/queue-async
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap
smash@0.0.12 ../../../node_modules/smash
├── queue-async@1.0.7
└── optimist@0.3.7 (wordwrap@0.0.2)

但是,安装后我似乎无法引用smash,它将Javascript文件合并为一个。

$ smash
bash: smash: command not found

我认为node.js实际上并没有在任何地方使用,只是由npm. 为什么我安装后找不到smash?

当我尝试运行时,make我得到了相关的错误:

make: node_modules/.bin/smash: Command not found
make: Nothing to be done for `all'.
4

1 回答 1

2

如果您想在 bash 提示符下使用粉碎(或几乎任何其他 npm 程序),您需要使用-g标志全局安装它。

npm install -g smash
于 2014-07-24T15:55:38.280 回答