-
Notifications
You must be signed in to change notification settings - Fork 3
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
Issue while installing the module with Yarn Berry v4.5.1 #18
Comments
Seems similar to #13 |
Hi @zaosoula, thanks for your bugreport. Unfortunately, I can't reproduce it on my side. To debug the issue, I will need some additional information. System:
Environment:
Clean installation log:
I would also be interested to see what happens when you install the package using |
System:
Environment:
Clean installation log:
from
I would also be interested to see what happens when you install the package using npm install --verbose @343dev/optimizt. I can't use npm install on this project as it use the workspace feature of Yarn to resolve local packages |
Thank you for the provided information. It seems that the issue is related to how Yarn Berry installs packages from different sources. When the package is installed from the npm registry: {
"dependencies": {
"guetzli": "^5.0.0"
}
} or from a locally available file: {
"dependencies": {
"guetzli": "./guetzli-5.0.0.tgz"
}
} the installed package has the following structure: .yarn/unplugged/guetzli-file-8486828326/node_modules/guetzli/
|-- cli.js
|-- index.js
|-- lib
| |-- index.js
| `-- install.js
|-- license
|-- package.json
|-- readme.md
|-- test
| `-- fixtures
| |-- dest.jpg
| `-- test.jpg
`-- vendor
|-- guetzli
`-- source
`-- guetzli-1.0.1.tar.gz
6 directories, 11 files However, when the package is installed directly from GitHub, as Optimizt currently does: {
"dependencies": {
"guetzli": "https://github.com/343dev/guetzli-bin/tarball/main"
}
} the installed package has the following structure: .yarn/unplugged/guetzli-https-aba22cc477/node_modules/guetzli/
|-- cli.js
|-- index.js
|-- lib
| |-- index.js
| `-- install.js
|-- license
|-- package.json
|-- readme.md
`-- vendor
`-- guetzli
3 directories, 8 files As you can see, three directories and three files are missing. During the installation of the “guetzli” package, Yarn Berry seems to remove the “test” and “source” directories. 🤯 Without these directories, the postinstall script from the package fails. First, it can’t find files from the “test/fixtures” directory to verify the execution of the guetzli binary:
Then, it tries to build the binary from source, but it can’t find the archive with the source code at “vendor/source/guetzli-1.0.1.tar.gz”:
|
As a temporary solution, I can suggest using Optimizt version 9.0.0. It seems that this version should not have the same issue. yarn add @343dev/[email protected] In the future, I plan to create my own package with guetzli to replace imagemin/guetzli-bin package, which has been abandoned by its author. However, I don’t have an exact timeline for this. |
@zaosoula, I have just released a new version of Optimizt. Please install it and let me know if the issue is resolved. |
I’m closing this as resolved. If you have any further questions, please feel free to reopen it or create a new issue. |
Hello, I'm trying to install version 9.1.0 on OSX, and this error happends
The text was updated successfully, but these errors were encountered: