Open Yanal-Yves opened 3 years ago
I experience the same on macos and Ubuntu. So I don't think that it is an OS specific issue.
I installed Desktop development with C++
(ID: Microsoft.VisualStudio.Workload.NativeDesktop) workload of VS 2019
I opened a Developer Command Prompt for VS2019
. BTW I think this is bad, npm install should work in any console (Powershell, bash or legacy command line).
When I run npm install --save-dev @datadog/datadog-ci
I now get the following error:
For me, the error came from an optional dependency @datadog/datadog-ci
-> ssh2
-> cpu-features
It works if I add --ignore-optional
yarn add --ignore-optional @datadog/datadog-ci
I have just tested :
On Windows 10 npm install --save-dev @datadog/datadog-ci --no-optional
works only if I run it inside a Developper Command Prompt for VS 2019
. If I run it in Command prompt inside my VSCode I get an error saying 'cmake' is not recognized as an internal or external command
On centos npm install --save-dev @datadog/datadog-ci --no-optional
succeed :
I am wondering what are these optional dependencies, why should I ignore them, how do they affect the datadog-ci ?
Describe what happened
Steps to reproduce the issue: 📝I just run
npm install --save-dev @datadog/datadog-ci
Expected behaviour: 📝datadog-ci get installed or a clear message explains what are the dependencies/pre-requisties
Actual behaviour: 📝When I try to install datadog-ci on my build server (centos 7), it fails :
Click to see the log
``` $ npm install --save-dev @datadog/datadog-ci npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. > cpu-features@0.0.2 install /home/centos/test/my-app/node_modules/cpu-features > node-gyp rebuild make: Entering directory `/home/centos/test/my-app/node_modules/cpu-features/build' ACTION Configuring dependencies /home/centos/test/my-app/node_modules/cpu-features/deps/cpu_features/build/Makefile /bin/sh: cmake: command not found make: *** [/home/centos/test/my-app/node_modules/cpu-features/deps/cpu_features/build/Makefile] Error 127 make: Leaving directory `/home/centos/test/my-app/node_modules/cpu-features/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:314:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 3.10.0-1160.25.1.el7.x86_64 gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/centos/test/my-app/node_modules/cpu-features gyp ERR! node -v v12.22.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok > dd-trace@0.35.1-beta.1 install /home/centos/test/my-app/node_modules/dd-trace > (node scripts/should_rebuild && node-gyp-build) || exit 0 make: Entering directory `/home/centos/test/my-app/node_modules/dd-trace/build' CXX(target) Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Collector.o make: g++: Command not found make: *** [Release/obj.target/metrics/packages/dd-trace/src/native/metrics/Collector.o] Error 127 make: Leaving directory `/home/centos/test/my-app/node_modules/dd-trace/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/centos/test/my-app/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:314:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 3.10.0-1160.25.1.el7.x86_64 gyp ERR! command "/usr/bin/node" "/home/centos/test/my-app/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/centos/test/my-app/node_modules/dd-trace gyp ERR! node -v v12.22.1 gyp ERR! node-gyp -v v7.1.2 gyp ERR! not ok > ssh2@1.1.0 install /home/centos/test/my-app/node_modules/ssh2 > node install.js make: Entering directory `/home/centos/test/my-app/node_modules/ssh2/lib/protocol/crypto/build' CXX(target) Release/obj.target/sshcrypto/src/binding.o make: g++: Command not found make: *** [Release/obj.target/sshcrypto/src/binding.o] Error 127 make: Leaving directory `/home/centos/test/my-app/node_modules/ssh2/lib/protocol/crypto/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:314:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 3.10.0-1160.25.1.el7.x86_64 gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "--target=v12.22.1" "rebuild" gyp ERR! cwd /home/centos/test/my-app/node_modules/ssh2/lib/protocol/crypto gyp ERR! node -v v12.22.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok Failed to build optional crypto binding > protobufjs@6.11.2 postinstall /home/centos/test/my-app/node_modules/protobufjs > node scripts/postinstall > aws-sdk@2.903.0 postinstall /home/centos/test/my-app/node_modules/aws-sdk > node scripts/check-node-version.js npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 (node_modules/cpu-features): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 install: `node-gyp rebuild` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 + @datadog/datadog-ci@0.13.8 added 118 packages from 220 contributors and audited 1443 packages in 16.637s 87 packages are looking for funding run `npm fund` for details found 1 moderate severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details ```📝When I try to install datadog-ci on my Windows 10 laptop, it fails too :
Click to see the log
``` npm install --save-dev @datadog/datadog-ci > cpu-features@0.0.2 install C:\_src\ProthesisDentalSolutions\Prothesis\src\Prothesis\ClientApp\node_modules\cpu-features > node-gyp rebuild C:\_src\ProthesisDentalSolutions\Prothesis\src\Prothesis\ClientApp\node_modules\cpu-features>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch. Configuring dependencies 'cmake' is not recognized as an internal or external command, operable program or batch file. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\_src\ProthesisDentalSolutions\Prothe sis\src\Prothesis\ClientApp\node_modules\cpu-features\deps\cpu_features\CMakeLists.txt' exited with code 9009. [C:\_src\ProthesisDentalSolutions\Prothesis\src\Prothesis\ClientApp\node_modules\cpu- features\build\config_deps.vcxproj] ←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mbuild error←[0m ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1 ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m at ChildProcess.emit (events.js:210:5) ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mstack←[0m at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mSystem←[0m Windows_NT 10.0.19043 ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mcommand←[0m "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mcwd←[0m C:\_src\ProthesisDentalSolutions\Prothesis\src\Prothesis\ClientApp\node_modules\cpu-features ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mnode -v←[0m v12.13.1 ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mnode-gyp -v←[0m v5.0.5 ←[0m←[37;40mgyp←[0m ←[0m←[31;40mERR!←[0m ←[0m←[35mnot ok←[0m npm WARN tsutils-etc@1.2.2 requires a peer of tsutils@^3.0.0 but none is installed. You must install peer dependencies yourself. npm WARN ws@7.4.6 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN ws@7.4.6 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 (node_modules\cpu-features): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 install: `node-gyp rebuild` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 + @datadog/datadog-ci@0.13.8 updated 1 package in 17.881s ```Additional context
Centos 7
andWindows 10
v12.13.1
Desktop development with C++ (ID: Microsoft.VisualStudio.Workload.NativeDesktop)
workload should be installed at least but I couldn't figure out yet why it still fails to install. IMHO, a clear explanation of the datadog-ci prerequisites is missing.