Failing to compile node (error: expected '{' after '\$' escape sequence)

115 views
Skip to first unread message

Niv

unread,
Aug 5, 2022, 10:50:26 PM8/5/22
to nw.js
Hey,

I'm having issues with compiling the node.js.

I've successfully built the nwjs, it's just the node that keeps failing.

I've opened an issue in github:

but it was closed with the answer that i'm not configuring something right in the node.

Please help me understand what is this parameter CONFIGURATION_NAME and how do I configure it.

Thanks.

The compilation log:


$ ninja -C src/out/Release_x64 node
ninja: Entering directory `src/out/Release_x64'
[1/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\md4\openssl.md4_one.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[2/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\md5\openssl.md5_one.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[3/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.cversion.obj
FAILED: obj/third_party/node-nw/deps/openssl/openssl/crypto/openssl.cversion.obj
ninja -t msvc -e environment.x64 -- "....\third_party\llvm-build\Release+Asserts\bin\clang-cl" -m64 /nologo /showIncludes /FC @obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.cversion.obj.rsp /c ....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c /Foobj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.cversion.obj /Fdobj\third_party\node-nw\deps\openssl\openssl.c.pdb
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(63,33): warning: unknown escape sequence '\ ' [-Wunknown-escape-sequence]
return "OPENSSLDIR: "" OPENSSLDIR """;
^~~~~~~~~~
(32,32): note: expanded from here
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(63,33): warning: unknown escape sequence '\ ' [-Wunknown-escape-sequence]
return "OPENSSLDIR: "" OPENSSLDIR """;
^~~~~~~~~~
(32,47): note: expanded from here
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(75,33): warning: unknown escape sequence '\s' [-Wunknown-escape-sequence]
return "MODULESDIR: "" MODULESDIR """;
^~~~~~~~~~
(30,36): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(75,33): warning: unknown escape sequence '$' [-Wunknown-escape-sequence]
return "MODULESDIR: "" MODULESDIR """;
^~~~~~~~~~
(30,40): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(75,33): error: expected '{' after '$' escape sequence
return "MODULESDIR: "" MODULESDIR """;
^~~~~~~~~~
(30,61): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(75,33): warning: unknown escape sequence '\l' [-Wunknown-escape-sequence]
return "MODULESDIR: "" MODULESDIR """;
^~~~~~~~~~
(30,65): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\cversion.c(75,33): error: expected '{' after '\l' escape sequence
return "MODULESDIR: "" MODULESDIR """;
^~~~~~~~~~
(30,69): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
6 warnings and 2 errors generated.
[4/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.trace.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[5/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\modes\openssl.cfb128.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[6/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\mdc2\openssl.mdc2dgst.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[7/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\modes\openssl.cbc128.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[8/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\mdc2\openssl.mdc2_one.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[9/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\md4\openssl.md4_dgst.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[10/1106] COPY ....\third_party\icu\windows\icudt.dll icudt.dll
[11/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\modes\openssl.ccm128.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[12/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.provider_core.obj
FAILED: obj/third_party/node-nw/deps/openssl/openssl/crypto/openssl.provider_core.obj
ninja -t msvc -e environment.x64 -- "....\third_party\llvm-build\Release+Asserts\bin\clang-cl" -m64 /nologo /showIncludes /FC @obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.provider_core.obj.rsp /c ....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c /Foobj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.provider_core.obj /Fdobj\third_party\node-nw\deps\openssl\openssl.c.pdb
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c(886,32): warning: unknown escape sequence '\s' [-Wunknown-escape-sequence]
load_dir = MODULESDIR;
^~~~~~~~~~
(30,36): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c(886,32): warning: unknown escape sequence '$' [-Wunknown-escape-sequence]
load_dir = MODULESDIR;
^~~~~~~~~~
(30,40): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c(886,32): error: expected '{' after '$' escape sequence
load_dir = MODULESDIR;
^~~~~~~~~~
(30,61): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c(886,32): warning: unknown escape sequence '\l' [-Wunknown-escape-sequence]
load_dir = MODULESDIR;
^~~~~~~~~~
(30,65): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\provider_core.c(886,32): error: expected '{' after '\l' escape sequence
load_dir = MODULESDIR;
^~~~~~~~~~
(30,69): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
4 warnings and 2 errors generated.
[13/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\md5\openssl.md5_dgst.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[14/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.threads_win.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
1 warning generated.
[15/1106] CC obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.info.obj
FAILED: obj/third_party/node-nw/deps/openssl/openssl/crypto/openssl.info.obj
ninja -t msvc -e environment.x64 -- "....\third_party\llvm-build\Release+Asserts\bin\clang-cl" -m64 /nologo /showIncludes /FC @obj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.info.obj.rsp /c ....\third_party\node-nw\deps\openssl\openssl\crypto\info.c /Foobj\third_party\node-nw\deps\openssl\openssl\crypto\openssl.info.obj /Fdobj\third_party\node-nw\deps\openssl\openssl.c.pdb
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
In file included from :342:
(32,9): warning: 'OPENSSLDIR' macro redefined [-Wmacro-redefined]
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^
(31,9): note: previous definition is here
#define OPENSSLDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib"
^
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(172,16): warning: unknown escape sequence '\ ' [-Wunknown-escape-sequence]
return OPENSSLDIR;
^~~~~~~~~~
(32,32): note: expanded from here
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(172,16): warning: unknown escape sequence '\ ' [-Wunknown-escape-sequence]
return OPENSSLDIR;
^~~~~~~~~~
(32,47): note: expanded from here
#define OPENSSLDIR "C:\Program\ Files\Common\ Files\SSL"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(176,16): warning: unknown escape sequence '\s' [-Wunknown-escape-sequence]
return MODULESDIR;
^~~~~~~~~~
(30,36): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(176,16): warning: unknown escape sequence '$' [-Wunknown-escape-sequence]
return MODULESDIR;
^~~~~~~~~~
(30,40): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(176,16): error: expected '{' after '$' escape sequence
return MODULESDIR;
^~~~~~~~~~
(30,61): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(176,16): warning: unknown escape sequence '\l' [-Wunknown-escape-sequence]
return MODULESDIR;
^~~~~~~~~~
(30,65): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
....\third_party\node-nw\deps\openssl\openssl\crypto\info.c(176,16): error: expected '{' after '\l' escape sequence
return MODULESDIR;
^~~~~~~~~~
(30,69): note: expanded from here
#define MODULESDIR "C:\nwjs\nwjs671\src$|CONFIGURATION_NAME\obj\lib\openssl-modules"
^~
6 warnings and 2 errors generated.
[16/1106] CC obj\third_party\node-nw\deps\histogram\src\histogram.hdr_histogram.obj
clang-cl: warning: argument unused during compilation: '-std:c++17' [-Wunused-command-line-argument]
....\third_party\node-nw\deps\histogram\src\hdr_histogram.c(143,23): warning: incompatible pointer types passing 'uint32_t *' (aka 'unsigned int ') to parameter of type 'unsigned long ' [-Wincompatible-pointer-types]
_BitScanReverse64(&leading_zero, value);
^~~~~~~~~~~~~
C:\nwjs\nwjs671\src\third_party\llvm-build\Release+Asserts\lib\clang\15.0.0\include\intrin.h(249,48): note: passing argument to parameter '_Index' here
unsigned char _BitScanReverse64(unsigned long _Index, unsigned __int64 _Mask);
^
In file included from ....\third_party\node-nw\deps\histogram\src\hdr_histogram.c:18:
....\third_party\node-nw\deps\histogram\src/hdr_atomic.h(23,13): warning: unused function 'hdr_atomic_store_pointer' [-Wunused-function]
static void hdr_atomic_store_pointer(void
pointer, void
value)
^
2 warnings generated.
ninja: build stopped: subcommand failed.

Roger Wang

unread,
Aug 8, 2022, 12:00:22 PM8/8/22
to nw.js
Try this command as in the official build log when you config Node:

Niv

unread,
Aug 8, 2022, 12:24:11 PM8/8/22
to nw.js
you mean i should run this commmand:
GYP_CHROMIUM_NO_ACTION=0 ./build/gyp_chromium -I third_party/node-nw/common.gypi -D building_nw=1 -D clang=1 third_party/node-nw/node.gyp

and then
python3 third_party/node-nw/tools/gyp/gyp_main.py -I third_party/node-nw/common.gypi -D msvs_version=2021 -D build_type=Release_x64 third_party/node-nw/node.gyp


under the folder src?

Roger Wang

unread,
Aug 8, 2022, 12:26:15 PM8/8/22
to Niv, nw.js
No. Just run the 2nd command.

--
You received this message because you are subscribed to a topic in the Google Groups "nw.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwjs-general/2NJK-2igxIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/780836c0-c4db-4d90-996e-3d57b27c6185n%40googlegroups.com.

Niv

unread,
Aug 8, 2022, 12:29:58 PM8/8/22
to nw.js
I tried the following:
"C:/Python38/python.exe" third_party/node-nw/tools/gyp/gyp_main.py -I third_party/node-nw/common.gypi -D msvs_version=2019 -D build_type=Release_x64 third_party/node-nw/node.gyp

(I don't have visual studio 2021 so i changed to 2019)

and it didn't create Release_x64 folder. in fact, it didn't create anything in out besides nw that was already there

Roger Wang

unread,
Aug 8, 2022, 12:36:59 PM8/8/22
to Niv, nw.js
You'll also need the correct environment variables. See 'DEPOT_TOOLS_WIN_TOOLCHAIN' and those names start with 'GYP'.

You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/2563a696-5955-444f-b748-3e4ca68813dbn%40googlegroups.com.

Niv

unread,
Aug 8, 2022, 12:44:39 PM8/8/22
to nw.js
Ok I added them, but still after executing this command the folder Release_x64 is not created under "out" folder.

Who creates this folder?

I must run the command:
ninja -C out/nw nwjs

To know if node is fixed or not?

Roger Wang

unread,
Aug 8, 2022, 12:56:59 PM8/8/22
to Niv, nw.js
What environment variables did you add? And what's their values?

Niv

unread,
Aug 8, 2022, 1:04:21 PM8/8/22
to nw.js
DEPOT_TOOLS_WIN_TOOLCHAIN=0
GYP_DEFINES=target_arch=x64 building_nw=1 icu_use_data_file_flag=1 host_arch=x64 clang=1 nwjs_sdk=1 disable_nacl=0 buildtype=Official
GYP_GENERATOR_FLAGS=output_dir=outst
GYP_GENERATORS=ninja
GYP_MSVS_OVERRIDE_PATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community
GYP_MSVS_VERSION=2017
vs2017_install=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
vs2019_install=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

Everything added through the UI of windows, and i tried the commands after I added them in a new git bash

Roger Wang

unread,
Aug 8, 2022, 1:06:31 PM8/8/22
to Niv, nw.js
'GYP_GENERATOR_FLAGS=output_dir=outst' -- the output files will be generated under 'outst' directory, not the 'out' directory you are using.

Niv

unread,
Aug 8, 2022, 1:30:49 PM8/8/22
to nw.js
Thank you so much!!
Reply all
Reply to author
Forward
0 new messages