Skip to content

Commit

Permalink
ignore node_modules in npm when skip-auto-install applied
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Nov 4, 2024
1 parent bec6e4e commit 8748f3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/utils/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ func CalculateDependenciesMap(executablePath, srcPath, moduleId string, npmListP
return nil, err
}
var data []byte
// If we don't have node_modules, the function will use the package-lock dependencies.
if nodeModulesExist && !npmListParams.IgnoreNodeModules {
// When `skipInstall` is true, we aim to rely on the dependencies specified in the package-lock, so Frogbot will not execute 'npm ls' on modules that are unbuilt and lack lock files (which may still have incomplete node_modules that could cause errors).
if nodeModulesExist && !npmListParams.IgnoreNodeModules && !skipInstall {
data = runNpmLsWithNodeModules(executablePath, srcPath, npmListParams.Args, log)
} else {
// If we don't have node_modules, the function will use the package-lock dependencies.
data, err = runNpmLsWithoutNodeModules(executablePath, srcPath, npmListParams, log, npmVersion, skipInstall)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8748f3e

Please sign in to comment.