[build] See what happened when npm install fails

This commit is contained in:
John Firebaugh
2018-07-19 15:47:50 -07:00
parent fb736e8ef0
commit 7e5b054566

View File

@@ -44,9 +44,13 @@ if(WITH_NODEJS)
execute_process(
COMMAND "${NodeJS_EXECUTABLE}" "${npm_EXECUTABLE}" install --ignore-scripts
WORKING_DIRECTORY "${DIRECTORY}"
RESULT_VARIABLE NPM_INSTALL_FAILED)
RESULT_VARIABLE NPM_INSTALL_FAILED
OUTPUT_VARIABLE NPM_OUTPUT
ERROR_VARIABLE NPM_OUTPUT)
if(NOT NPM_INSTALL_FAILED)
execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${DIRECTORY}/node_modules/.${NAME}.stamp")
else()
message(FATAL_ERROR "NPM install failed:\n${NPM_OUTPUT}")
endif()
endif()