node-pty-prebuilt-multiarch icon indicating copy to clipboard operation
node-pty-prebuilt-multiarch copied to clipboard

nan: Use direct GitHub tarball url to remove dependency on git cli

Open bjia56 opened this issue 1 year ago • 4 comments

:recycle: Current situation

Describe the current situation. Explain current problems, if there are any. Be as descriptive as possible (e.g., including examples or code snippets).

Scrypted installs @homebridge/node-pty-prebuilt-multiarch inside a Docker image that does not have the git cli tool installed. With the recent 0.11.13 release and #40, the nan dependency now points to a GitHub repo, which npm will try to download by spawning git. This gives the following error:

root@host:/server# npm i @homebridge/[email protected]
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -2
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-03-14T16_24_04_701Z-debug-0.log

:bulb: Proposed solution

Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?

Replace the npm version pointer to an https direct link to the target repo tarball to drop the dependency on git.

:gear: Release Notes

Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.

:heavy_plus_sign: Additional Information

If applicable, provide additional context in this section.

No changes to the user.

Testing

Which tests were added? Which existing tests were adapted/changed? Which situations are covered, and what edge cases are missing?

No tests added.

Reviewer Nudging

Where should the reviewer start? what is a good entry point?

bjia56 avatar Mar 14 '24 16:03 bjia56

This repo seems significantly diverged from upstream. I forked off Microsoft which is using node addon api now rather than nan (and greatly simplifies builds). It also obsoletes this bug. Scrypted prebuilts are here now

https://github.com/scryptedapp/node-pty

koush avatar Mar 14 '24 22:03 koush

@koush you don't need this ?

I had updated our fork last year, but as you have found they have a better fix for these

NorthernMan54 avatar Mar 15 '24 17:03 NorthernMan54

Scrypted no longer needs this pull request as we forked node-pty and did fresh builds. But the pull request is still probably a good fix as it reduces the install time dependencies on this package by removing git. So less chance at install failure, which is how we discovered it.

koush avatar Mar 15 '24 17:03 koush

Tks, I will take a look at the changes in your repo versus my slightly stale fork, and likely implement them. And not implement this.

NorthernMan54 avatar Mar 15 '24 17:03 NorthernMan54