MCPcopy Create free account
hub / github.com/cloudfoundry/nodejs-buildpack / WarnNodeEngine

Method WarnNodeEngine

src/nodejs/supply/supply.go:670–700  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

668}
669
670func (s *Supplier) WarnNodeEngine() {
671 docsLink := "http://docs.cloudfoundry.org/buildpacks/node/node-tips.html"
672
673 if s.NvmrcNodeVersion != "" && s.PackageJSONNodeVersion == "" {
674 s.Log.Warning("Using the node version specified in your .nvmrc See: %s", docsLink)
675 }
676
677 if s.PackageJSONNodeVersion != "" && s.NvmrcNodeVersion != "" && s.PackageJSONNodeVersion != s.NvmrcNodeVersion {
678 s.Log.Warning("Node version in .nvmrc ignored in favor of 'engines' field in package.json")
679 }
680
681 if s.PackageJSONNodeVersion == "" && s.NvmrcNodeVersion == "" {
682 s.Log.Warning("Node version not specified in package.json or .nvmrc. See: %s", docsLink)
683 }
684
685 if s.PackageJSONNodeVersion == "*" {
686 s.Log.Warning("Dangerous semver range (*) in engines.node. See: %s", docsLink)
687 }
688
689 if s.NvmrcNodeVersion == "node" {
690 s.Log.Warning(".nvmrc specified latest node version, this will be selected from versions available in manifest.yml")
691 }
692
693 if strings.HasPrefix(s.NvmrcNodeVersion, "lts") {
694 s.Log.Warning(".nvmrc specified an lts version, this will be selected from versions available in manifest.yml")
695 }
696
697 if strings.HasPrefix(s.PackageJSONNodeVersion, ">") {
698 s.Log.Warning("Dangerous semver range (>) in engines.node. See: %s", docsLink)
699 }
700}
701
702func (s *Supplier) InstallNode() error {
703 dep := libbuildpack.Dependency{

Callers 2

supply_test.goFile · 0.80
RunFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected