-
Notifications
You must be signed in to change notification settings - Fork 92
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
Document installing using npm
directly
#242
Conversation
|
||
```sh | ||
npm install -g sfcc-ci | ||
``` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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 | ||
``` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnboxall Thanks for contributing! Changes have been merged into master. Building a new release is still pending. |
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 fromnpm
as it appears the tool is already available there: https://www.npmjs.com/package/sfcc-ciThis change adds that instruction to the top of the list of possible ways to install the tool.