【发布时间】:2015-10-30 05:43:07
【问题描述】:
我已经克隆了一个nodejs项目,该项目包含一个Makefile
SRC = $(wildcard lib/**/*.js)
CSS = $(wildcard lib/**/*.css)
HTML = $(wildcard lib/**/*.html)
COMPONENTJSON = $(wildcard lib/*/component.json)
TEMPLATES = $(HTML:.html=.js)
build: components $(SRC) $(CSS) $(TEMPLATES)
@echo building
@component build
components: component.json $(COMPONENTJSON)
@echo installing
@component install
%.js: %.html
@echo converting
@component convert $<
minify:
@component build --use component-minify
clean:
@echo cleaning
rm -fr build components $(TEMPLATES)
.PHONY: clean minify
之前我不知道 make 可以用来构建 javascript,当我运行 make 时出现错误
installing
make: component: Command not found
make: *** [components] Error 127
我的问题是,
1.是使用unix系统提供的默认make,还是使用其他某种节点库?
2.如果是同一个系统默认,为什么会报错?
link to the example project
【问题讨论】:
-
你有什么解决办法吗?请分享。谢谢。
-
@Waqas 是的,我收到错误的原因是因为我的系统中没有安装组件,它与 unix 系统中的 makefile 相同,即使用已安装的节点组件来运行任务.
标签: javascript node.js makefile