From 544fa7319c96abba60917875d5f71be2dec13ac8 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Thu, 24 Oct 2019 09:33:26 +1100 Subject: [PATCH] fix: force install when node_modules missing --- cmd/helpers.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/helpers.go b/cmd/helpers.go index b251333f..4d188e97 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -219,6 +219,15 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc const md5sumFile = "package.json.md5" + // If node_modules does not exist, force a rebuild. + nodeModulesPath, err := filepath.Abs(filepath.Join(".", "node_modules")) + if err != nil { + return err + } + if !fs.DirExists(nodeModulesPath) { + forceRebuild = true + } + // If we aren't forcing the install and the md5sum file exists if !forceRebuild && fs.FileExists(md5sumFile) { // Yes - read contents