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

Document installing using npm directly #242

Merged
merged 2 commits into from
Aug 17, 2021

Conversation

johnboxall
Copy link
Contributor

For folks that already have Node.js installed, which increasingly will become most SFCC developers as its a requirement of PWA Kit, I believe the most straight forward way to start using sfcc-ci will be install it directly from npm as it appears the tool is already available there: https://www.npmjs.com/package/sfcc-ci

This change adds that instruction to the top of the list of possible ways to install the tool.


```sh
npm install -g sfcc-ci
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I have problems at times to launch the global binary using npm. It is clearly my stupid setup mixing nvm and brew, but maybe it'd be worth pointing out that one can always launch sfcc-ci using npx sfcc-ci

Copy link
Contributor

Choose a reason for hiding this comment

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

@johnboxall Would you mind adding npx sfcc-ci as one alternative for using the CLI as @hnestmann suggested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you tell me more about why we'd recommend folks to use npx outside a specific set of one off circumstances (eg. you need to use exactly one command once from sfcc-ci in the context of a CI/CD pipeline)

It is significantly slower than installing it locally and using that:

$ node --version
v14.17.5
$ npm --version
6.14.14
$ time npx sfcc-ci
npx sfcc-ci  11.77s user 7.89s system 110% cpu 17.723 total

On my Mac, connected to blazing fast internet it takes ~12 seconds per invocation.

npx is great for tools like react-create-app or other things that you use once and never again. sfcc-ci doesn't feel like that to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For me its quick if it's installed on the machine. I think the biggest benefit is that it always works, even if the global command couldnt be registered by npm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting! I see npx changed a changed a bunch in Node 16: https://docs.npmjs.com/cli/v7/commands/npx#compatibility-with-older-npx-versions

Using the version included in Node 16, I observe the caching behaviour you mention.

Sure, I'll update the docs to mention that approach as well.

Copy link
Contributor

@tobiaslohr tobiaslohr left a comment

Choose a reason for hiding this comment

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

@johnboxall Thanks a lot for providing a PR! Please see my comments below.


```sh
npm install -g sfcc-ci
```
Copy link
Contributor

Choose a reason for hiding this comment

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

@johnboxall Would you mind adding npx sfcc-ci as one alternative for using the CLI as @hnestmann suggested?

@tobiaslohr tobiaslohr added the doc label Aug 12, 2021
@tobiaslohr tobiaslohr added this to the 2.7.3 milestone Aug 12, 2021
Copy link
Contributor

@tobiaslohr tobiaslohr left a comment

Choose a reason for hiding this comment

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

@tobiaslohr tobiaslohr merged commit d7bc7ac into SalesforceCommerceCloud:master Aug 17, 2021
@tobiaslohr
Copy link
Contributor

@johnboxall Thanks for contributing! Changes have been merged into master. Building a new release is still pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants