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

Request to remove cpu-features. #1139

Closed
cweijan opened this issue Mar 3, 2022 · 7 comments
Closed

Request to remove cpu-features. #1139

cweijan opened this issue Mar 3, 2022 · 7 comments

Comments

@cweijan
Copy link

cweijan commented Mar 3, 2022

Hi, your library has an optional dependency on cpu-features, but it will be installed during npm install, and an error will be reported if the node-gyp environment is not installed.

But users with node-gyp environment are few, now ssh2 works fine, I don't want to install node-gyp environment for this optional feature.
image

@cweijan
Copy link
Author

cweijan commented Mar 3, 2022

I saw the previous discussion, cpu-features is used to choose a better algorithm, is it possible to consider using other methods to choose an algorithm.

@mscdex
Copy link
Owner

mscdex commented Mar 3, 2022

I don't want to install node-gyp environment for this optional feature

Then don't install it. ssh2 is usable without the optional dependency.

@cweijan
Copy link
Author

cweijan commented Mar 3, 2022

I think I've described it clearly, it will be installed when I do npm install, if I don't specify --no-optional, this error message is annoying.
If you don't plan to remove, I will close this issue.

@mscdex
Copy link
Owner

mscdex commented Mar 3, 2022

Also relevant: #1114

I will close this for now as there is nothing actionable.

@mscdex mscdex closed this as completed Mar 3, 2022
@cweijan
Copy link
Author

cweijan commented Jul 11, 2022

Hi @mscdex ,

I have been troubled by this problem again recently, I think a possible way is to move cpu-feature to devDependencies, this will not have any effect on you, for ssh2 users, cpu-feature is now really become Optional dependencies.

@ArminEberle
Copy link

Just commenting that the cpu-features thingy is giving me a hard time as well, we are building an electron-app with electron-builder.
The bad thing is that electron-builder does a cross-platform install but will not do yarn install --ignore-optional automatically.
And the setup of the node-gyp environment is rather fragile.
So for some developers, they can build the electron-app nicely on their windows-pc, others just won't. Like me.
So my attempt is to do the cross-platform yarn install on my own, but this is adding lots of additional build-code and has its own problem possibilities.

@cweijan
Copy link
Author

cweijan commented Feb 29, 2024

To avoid this problem, I released a package with cpu-features removed, @cweijan/ssh2, if anyone suffers from this, you can use it: npm i @cweijan/ssh2

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

No branches or pull requests

3 participants