Souparno Majumder Souparno Majumder - 1 year ago 112
Node.js Question

Buiding javascript with Makefile

I have cloned a nodejs project, and the project containes a 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 $<

@component build --use component-minify

@echo cleaning
rm -fr build components $(TEMPLATES)

.PHONY: clean minify

I didnot know before that make can be used to build javascript, and when i am running
I am getting the error

make: component: Command not found
make: *** [components] Error 127

My qestion is, it using the same default make provided by unix system, or is it using some kind of other node library?

2.if it is the same system default, why I am getting the error?

link to the example project

Answer Source

The file is using the same make found in any unix/linux system. The error was due to the unavailability of the component package. I installed component using:

npm install -g component
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download