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

Too many non-runtime dependencies after installation #1774

Open
fenying opened this issue Mar 29, 2024 · 0 comments
Open

Too many non-runtime dependencies after installation #1774

fenying opened this issue Mar 29, 2024 · 0 comments

Comments

@fenying
Copy link

fenying commented Mar 29, 2024

Issue Summary

First of all, thanks to the maintainers, this package is a nice job.

I just wanna point out that, after installing this package, there are 123 dependencies installed which are mostly useless because there not required for run-time.

Let me explain, prebuild-install, yes I know what it is and how it works. Indeed it provides a convenient way to installing C/C++ addons without compilation. I agree that it's helpful but only within installation. Also, node-gyp and tar are the same.

I would suggess to replace the install script in the package.json with this command:

npx -y prebuild-install@^7.1.1 -r napi || npx -y node-gyp@^8.0.0 rebuild

And then prebuild-install and node-gyp are no longer needed in the dependencies list, becuase it will only be used during installation, and will not be installed into anywhere except the NPM cache.

Finally, the tar package, I know it's used to extract the source from the .tar.gz file, but I believe that we could actually try tar command firstly, and use the extract.js as a fallback, like this:

tar -zxf xxxx.tgz -C dst_path || (npm i tar && node extract.js) # not tested, but may work.

How do you think? If I missed something, please point it out. Or if you agree, I could create a PR for this.

Relevant logs or output

$ npm i sqlite3
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs

added 123 packages in 28s

Version

5.1.7

Node.js Version

20.12.0

How did you install the library?

npm i sqlite3, on Linux x86_64

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

No branches or pull requests

1 participant