Tried to install node-sqlite3 and got:
$ npm install -s node-sqlite3
CXX(target) Release/obj.target/node_sqlite3/src/third_party/CodingConv/encodeutil.o
../src/third_party/CodingConv/encodeutil.cpp:179:31: error: use of undeclared identifier 'LC_ALL'
string curLocale = setlocale(LC_ALL,NULL);
^
../src/third_party/CodingConv/encodeutil.cpp:180:12: error: use of undeclared identifier 'LC_ALL'
setlocale(LC_ALL,"chs");
^
../src/third_party/CodingConv/encodeutil.cpp:188:12: error: use of undeclared identifier 'LC_ALL'; did you mean 'P_ALL'?
setlocale(LC_ALL,curLocale.c_str());
^~~~~~
P_ALL
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:80:2: note:
'P_ALL' declared here
P_ALL,
^
../src/third_party/CodingConv/encodeutil.cpp:197:31: error: use of undeclared identifier 'LC_ALL'
string curLocale = setlocale(LC_ALL,NULL);
^
../src/third_party/CodingConv/encodeutil.cpp:198:12: error: use of undeclared identifier 'LC_ALL'
setlocale(LC_ALL,"chs");
^
../src/third_party/CodingConv/encodeutil.cpp:206:12: error: use of undeclared identifier 'LC_ALL'; did you mean 'P_ALL'?
setlocale(LC_ALL,curLocale.c_str());
^~~~~~
P_ALL
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:80:2: note:
'P_ALL' declared here
P_ALL,
^
6 errors generated.
make: *** [Release/obj.target/node_sqlite3/src/third_party/CodingConv/encodeutil.o] Error 1
This is on macOS 10.14 Mojave, Xcode 10, node v8.11.1 and npm 6.4.1.
Also got this error.
fixed in new version confirmed.
fixed in new version confirmed.
@magneticchen Can you provide more context?
@mario-grgic reproduced same issue here on macOS 10.13.6 High Sierra, Xcode 10, node v11.2.0, npm v6.5.0
_edit_ just re-read, and it seems that this is only intended for use with node up to v10. switched with nvm to node v10 and still same error.
I don't have a Mac OS so I can not debug.
It seems like a depency issue so perhaps try brew install ninja.
If I clone this repo and make it all builds correctly. If I do npm install node-sqlite3 it still fails with the above error.
Installing ninja of course made no difference. The errors are complaining about undefined LC_ALL macro.
Same error on High Sierra 10.13.6, node v8.12 when installing from npm.
So the issue is that node-sqlite3 in npm is a different package that seems to have deceptively similar name to this repo. The npm package for this repo is sqlite3, not node-sqlite3.
So the issue is that node-sqlite3 in npm is a different package that seems to have deceptively similar name to this repo. The npm package for this repo is sqlite3, not node-sqlite3.
Wow, that's horrible. Especially since this project's GitHub repo is called node-sqlite3. And yes, npm install sqlite3 works.
Most helpful comment
So the issue is that node-sqlite3 in npm is a different package that seems to have deceptively similar name to this repo. The npm package for this repo is sqlite3, not node-sqlite3.