You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a local package (Package B) with an executable bin file is installed in another project (Project A), and then Package B is updated, running yarn install in Project A to update the package results in the loss of the executable permission on the bin file.
The executable permission can be restored manually on the bin file, and the package will work as expected.
If the executable permission is set on the bin file in the local Package B, the issue does not occur.
However, it is unnatural for the executable permission to be lost when updating the package. This behavior does not occur when installing remote packages, and local packages should behave in the same way as remote packages.
Validate the successful execution of the bin file in project A:
package-b
# Output: 'before'
Modify package B:
Update bin.js:
// console.log('before');console.log('after');
Update package B in project A and execute the bin file:
yarn install
package-b
You will encounter the following error message:
Volta error: Could not execute `package-b`
Please ensure you have correct permissions to access the file.
To temporarily resolve the issue, you can either:
Remove and reinstall package B:
yarn remove package-b
yarn add ../package-b
Set the executable permission on bin.js in package B:
chmod +x bin.js
These reproduction steps clearly outline the process of setting up the project structure, creating the necessary files, and demonstrating the loss of executable permission on the bin file after running yarn install. The temporary workarounds are also provided.
Self-service
Describe the bug
When a local package (Package B) with an executable bin file is installed in another project (Project A), and then Package B is updated, running yarn install in Project A to update the package results in the loss of the executable permission on the bin file.
The executable permission can be restored manually on the bin file, and the package will work as expected.
If the executable permission is set on the bin file in the local Package B, the issue does not occur.
However, it is unnatural for the executable permission to be lost when updating the package. This behavior does not occur when installing remote packages, and local packages should behave in the same way as remote packages.
To reproduce
To reproduce the issue, follow these steps:
package.json
:bin.js
:package.json
:Run
yarn add ../package-b
to install package B.package-b # Output: 'before'
You will encounter the following error message:
These reproduction steps clearly outline the process of setting up the project structure, creating the necessary files, and demonstrating the loss of executable permission on the bin file after running
yarn install
. The temporary workarounds are also provided.Environment
System: OS: macOS 13.5 CPU: (10) arm64 Apple M2 Pro Binaries: Node: 20.9.0 - /private/var/folders/gh/9qf38ks575gdynfchc6z_2j00000gn/T/xfs-5139bdfb/node Yarn: 4.0.1 - /private/var/folders/gh/9qf38ks575gdynfchc6z_2j00000gn/T/xfs-5139bdfb/yarn npm: 10.1.0 - ~/.volta/tools/image/node/20.9.0/bin/npm
Additional context
No response
The text was updated successfully, but these errors were encountered: