Skip to content

Commit

Permalink
Provide a better error message during pulumi new if no nodejs package…
Browse files Browse the repository at this point in the history
… manager is installed
  • Loading branch information
julienp committed May 3, 2024
1 parent a2b2276 commit 741caba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdk/nodejs
description: Provide a better error message during pulumi new if no nodejs package manager is installed
5 changes: 3 additions & 2 deletions sdk/nodejs/npm/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package npm

import (
"context"
"errors"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -100,8 +101,8 @@ func ResolvePackageManager(pwd string) (PackageManager, error) {
// Finally, fall back to npm.
node, err := newNPM()
if err != nil {
return nil, fmt.Errorf("could not find npm on the $PATH; npm is installed with Node.js "+
"available at https://nodejs.org/: %w", err)
return nil, errors.New("could not find npm on the $PATH; make sure npm is installed and run " +
"'pulumi install' to complete the project setup")
}

return node, nil
Expand Down

0 comments on commit 741caba

Please sign in to comment.