-
I run $ make format-cpp-build
cd tools/clang-format && if [ -x /Users/feng/dev/node/./node ] && [ -e /Users/feng/dev/node/./node ]; then /Users/feng/dev/node/./node /Users/feng/dev/node/./deps/npm/bin/npm-cli.js ci; elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then `command -v node` /Users/feng/dev/node/./deps/npm/bin/npm-cli.js ci; else echo "No available node, cannot run \"node /Users/feng/dev/node/./deps/npm/bin/npm-cli.js ci\""; exit 1; fi;
added 19 packages, and audited 20 packages in 2s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp
Formatting C++ diff from f2498a36eeb42779abbfaa4fb29271d26f0ee457..
error: `tools/clang-format/node_modules/.bin/clang-format -style=file -lines=168:170 -lines=196:207 -lines=496:496 -lines=535:535 src/node_url.cc` failed
$ tools/clang-format/node_modules/.bin/clang-format -style=file -lines=168:170 -lines=196:207 -lines=496:496 -lines=535:535 src/node_url.cc
spawn Unknown system error -86% I tried but not find any guide in the Node.js repo on how to format cpp code in the local environment. |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments · 9 replies
-
I think you need to run There is also |
Beta Was this translation helpful? Give feedback.
All reactions
-
(Still looking to see if I can reproduce the issue. Suggestions/ideas more than welcome, of course.) |
Beta Was this translation helpful? Give feedback.
All reactions
-
error happen when invoke $ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp
Formatting C++ diff from f2498a36eeb42779abbfaa4fb29271d26f0ee457..
error: `tools/clang-format/node_modules/.bin/clang-format -style=file -lines=168:170 -lines=196:207 -lines=496:496 -lines=535:535 src/node_url.cc` failed
$ tools/clang-format/node_modules/.bin/clang-format -style=file -lines=168:170 -lines=196:207 -lines=496:496 -lines=535:535 src/node_url.cc
spawn Unknown system error -86% specially this line:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
After some debugging, I find angular clang-format's darwin_x64 binary could not run on my computer: ./tools/clang-format/node_modules/clang-format/bin/darwin_x64/clang-format
zsh: bad CPU type in executable: ./tools/clang-format/node_modules/clang-format/bin/darwin_x64/clang-format I searched google and found most of these errors show on mostly M1, but my computer is not m1 chip. I think it's a bug of |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
|
Beta Was this translation helpful? Give feedback.
All reactions
-
My fork branch is stale and is still staying on clang-format 1.7.0 which does not support Intel Macs. so I got an error: Node.js master branch's clang-format version has just upgraded to 1.8.0: 7a71ae8, this new version adds support for Intel Macs. after rebasing Nodejs upstream master, the problem is gone. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
All reactions
-
You can use |
Beta Was this translation helpful? Give feedback.
I think you need to run
make format-cpp-build
one time and that will installtools/clang-format/node_modules/.bin/clang-format
and themake format-cpp
command will (hopefully) start working after that.There is also
make format-cpp-clean
which is useful ifmake format-cpp-build
fails for some reason.