生成jQuery无法缩小,出现错误“0”/bin/sh:第0行:测试:/usr/bin/node:应为二进制运算符";,但是NodeJS安装在/usr/bin/node

生成jQuery无法缩小,出现错误“0”/bin/sh:第0行:测试:/usr/bin/node:应为二进制运算符";,但是NodeJS安装在/usr/bin/node,jquery,node.js,makefile,Jquery,Node.js,Makefile,我正在努力,但我遇到了一个奇怪的问题 我可以构建未缩小的版本,但当它尝试缩小js文件时,我会出现以下错误: > make ... Building ./dist/jquery.js /bin/sh: line 0: test: /usr/bin/node: binary operator expected You must have NodeJS installed in order to minify jQuery. /bin/sh: line 0: test: /usr/bin/node:

我正在努力,但我遇到了一个奇怪的问题

我可以构建未缩小的版本,但当它尝试缩小js文件时,我会出现以下错误:

> make ... Building ./dist/jquery.js /bin/sh: line 0: test: /usr/bin/node: binary operator expected You must have NodeJS installed in order to minify jQuery. /bin/sh: line 0: test: /usr/bin/node: binary operator expected You must have NodeJS installed in order to test jQuery against JSHint. /bin/sh: line 0: test: /usr/bin/node: binary operator expected You must have NodeJS installed in order to size jQuery. >制造 ... Building./dist/jquery.js /bin/sh:第0行:测试:/usr/bin/node:应为二进制运算符 为了缩小jQuery,必须安装NodeJS。 /bin/sh:第0行:测试:/usr/bin/node:应为二进制运算符 必须安装NodeJS,才能根据JSHint测试jQuery。 /bin/sh:第0行:测试:/usr/bin/node:应为二进制运算符 必须安装NodeJ才能调整jQuery的大小。
然而,奇怪的是NodeJS安装在
/usr/bin/node
上。这是怎么回事?

检查生成错误的一行:

@@if test ! -z ${JS_ENGINE}; then \
这里是在
Makefile
顶部定义
${JS_ENGINE}
的地方:

JS_ENGINE ?= `which node nodejs 2>/dev/null`
如果在我的系统上运行该命令,我会得到以下结果:

> which node nodejs 2>/dev/null /usr/bin/node /usr/bin/nodejs
为什么不直接导出JS_ENGINE=“node” make JS_ENGINE=`which node nodejs 2>/dev/null | head -n 1`