Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a better error message during pulumi new if no nodejs package manager is installed #16096

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We ok dropping the ref to the website to download from?

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