Something changed in the npm “nan” package today (Nov 5) to break previously-working smartos-live builds.
The errors look something like this at the end of the trainwreck:
/export/home/danmcd/smartos-live/proto.strap/usr/bin/g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/export/home/danmcd/.node-gyp/0.10.26/src -I/export/home/danmcd/.node-gyp/0.10.26/deps/uv/include -I/export/home/danmcd/.node-gyp/0.10.26/deps/v8/include -I../node_modules/nan -fPIC -Wall -Wextra -Wno-unused-parameter -m32 -pthreads -O2 -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/fs-ext/fs-ext.o.d.raw -m32 -g -fPIC -Wall -Wextra -Werror -Wno-cast-function-type -O2 -fno-aggressive-loop-optimizations -c -o Release/obj.target/fs-ext/fs-ext.o ../fs-ext.cc
In file included from ../fs-ext.cc:29:
../node_modules/nan/nan.h:435:59: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8::String'
435 | static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
| ^~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h: In function 'void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)':
../node_modules/nan/nan.h:2640:7: error: cannot convert 'v8::PropertyAttribute' to 'v8::AccessControl'
2640 | , attribute
| ^~~~~~~~~
| |
| v8::PropertyAttribute
In file included from /export/home/danmcd/.node-gyp/0.10.26/src/node.h:62,
from ../fs-ext.cc:20:
/export/home/danmcd/.node-gyp/0.10.26/deps/v8/include/v8.h:2392:34: note: initializing argument 5 of 'void v8::ObjectTemplate::SetAccessor(v8::Handle<v8::String>, v8::AccessorGetter, v8::AccessorSetter, v8::Handle<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::Handle<v8::AccessorSignature>)'
2392 | AccessControl settings = DEFAULT,
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from ../fs-ext.cc:29:
../node_modules/nan/nan.h: In function 'void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)':
../node_modules/nan/nan.h:2696:7: error: cannot convert 'v8::PropertyAttribute' to 'v8::AccessControl'
2696 | , attribute
| ^~~~~~~~~
| |
| v8::PropertyAttribute
In file included from /export/home/danmcd/.node-gyp/0.10.26/src/node.h:62,
from ../fs-ext.cc:20:
/export/home/danmcd/.node-gyp/0.10.26/deps/v8/include/v8.h:2392:34: note: initializing argument 5 of 'void v8::ObjectTemplate::SetAccessor(v8::Handle<v8::String>, v8::AccessorGetter, v8::AccessorSetter, v8::Handle<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::Handle<v8::AccessorSignature>)'
2392 | AccessControl settings = DEFAULT,
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
make[2]: *** [fs-ext.target.mk:86: Release/obj.target/fs-ext/fs-ext.o] Error 1
make[2]: Leaving directory '/export/home/danmcd/smartos-live/src/node-qlocker/node_modules/fs-ext/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/SmartOS/build-cache/2024Q4/x86_64/479aab6099387aeb2d1a56a15acc1363b2e484c7/usr/node/0.10/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System SunOS [���D��
gyp ERR! command "node" "/opt/SmartOS/build-cache/2024Q4/x86_64/479aab6099387aeb2d1a56a15acc1363b2e484c7/usr/node/0.10/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /export/home/danmcd/smartos-live/src/node-qlocker/node_modules/fs-ext
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! fs-ext@2.0.2 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fs-ext@2.0.2 install script.
npm ERR! This is most likely a problem with the fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls fs-ext
npm ERR! There is likely additional logging output above.
npm ERR! System SunOS
npm ERR! command "/usr/node/0.10/bin/node" "/export/home/danmcd/smartos-live/proto.strap/usr/node/0.10/bin/npm" "install" "--production" "--unsafe-perm"
npm ERR! cwd /export/home/danmcd/smartos-live/src/node-qlocker
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /export/home/danmcd/smartos-live/src/node-qlocker/npm-debug.log
npm ERR! not ok code 0
gmake[1]: *** [Makefile:245: node-qlocker] Error 1
gmake[1]: Leaving directory '/export/home/danmcd/smartos-live/src'
gmake: *** [Makefile:391: 0-livesrc-stamp] Error 2
Tweaking package.json files in smartos-live to use "nan": "~2.14.x" instead of "nan": "^2.14.x" and having node-qlocker use a modified node-0.10 branch of node-ext-fs with nan also fixed appears to fix things.
Dan McDonald commented on 2025-11-05T23:44:48.130-0500:
Version 2.23.1 of nan broke us, thanks to this commit in particular:
1743e81478109532303cc81599b99d672608a4dd
this caused our compilation error above. There may be other ways to fix this (update SmartOS node to 0.10.29 or later?), but the centering around 2.14 is the first attempt that seems to work.
We could also lock on 2.23.0, which should keep working. Code review will inform the best course of action.
Dan McDonald commented on 2025-11-06T09:12:54.575-0500 (edited 2025-11-06T09:14:20.553-0500):
Using ~2.14.x for x={0,1} I built all four combinations {gcc10,gcc14}-{default,debug} without error using the OS-8701 branch of smartos-live which under-review will reference the OS-8701 branch of node-fs-ext.