From 0c98353091e6c95f6a70a461d0146b7872a8f14d Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 7 Nov 2023 19:38:28 +0000 Subject: [PATCH] Node.js: Build/install fix A user on GitHub reported an issue when trying to build/install the nodejs language module. Doing a $ ./configure nodejs --node=/usr/bin/node --npm=/usr/bin/npm --node-gyp=/usr/bin/node-gyp $ make install was throwing the following error mv build/src//usr/bin/node/unit-http-g/unit-http-1.31.1.tgz build//usr/bin/node-unit-http-g.tar.gz mv: cannot move 'build/src//usr/bin/node/unit-http-g/unit-http-1.31.1.tgz' to 'build//usr/bin/node-unit-http-g.tar.gz': No such file or directory make: *** [build/Makefile:2061: build//usr/bin/node-unit-http-g.tar.gz] Error 1 The fact that we're using the path given by --node= to then use as directory locations seems erroneous. But rather than risk breaking existing expectations the simple fix is to just use build/src in the destination path above to match that of the source. These paths were added in some previous commits, and the missing 'src/' component looks like an oversight. After this commit both the following work $ ./configure nodejs --node-gyp=/usr/lib/node_modules/bin/node-gyp-bin/node-gyp --local=/opt/unit/node $ ./configure nodejs --node=/usr/bin/node --node-gyp=/usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp --local=/opt/unit/node Reported-by: ruspaul013 Tested-by: ruspaul013 Fixes: 0ee8de554 ("Fixed Makefile target for NodeJS.") Fixes: c84948386 ("Node.js: fixing module global installation.") Reviewed-by: Timo Stark Signed-off-by: Andrew Clayton --- auto/modules/nodejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto/modules/nodejs b/auto/modules/nodejs index 968f3fdf..472fb3be 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -123,8 +123,8 @@ fi NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http NXT_NODE_TMP_G=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http-g -NXT_NODE_TARBALL=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http.tar.gz -NXT_NODE_TARBALL_G=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http-g.tar.gz +NXT_NODE_TARBALL=${NXT_BUILD_DIR}/src/${NXT_NODE}-unit-http.tar.gz +NXT_NODE_TARBALL_G=${NXT_BUILD_DIR}/src/${NXT_NODE}-unit-http-g.tar.gz NXT_NODE_VERSION_FILE=${NXT_BUILD_DIR}/src/${NXT_NODE}/version.h NXT_NODE_PACKAGE_FILE=${NXT_BUILD_DIR}/src/${NXT_NODE}/package.json NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src \