SavageCore / node-ffprobe-installer

Platform independent binary installer of FFprobe for node projects
https://www.npmjs.com/package/@ffprobe-installer/ffprobe
72 stars 30 forks source link

pnpm install at macOS will cause error because of permission #262

Closed tim80411 closed 1 year ago

tim80411 commented 1 year ago

Enviroment

OS: Mac M1 Max Ventura 13.2.1 node: 18.14.2 package manager: pnpm 8.5.1 package version: 2.1.0

Reproduce

  1. pnpm store should have node-ffprobe-installer
  2. delete node_module and reinstall package by pnpm
  3. Permission error happened

Context

When using pnpm to install package. Shell "ffprobe" will be download at ~/{projectPath}/node_modules/.pnpm/@ffprobe-installer+ffprobe@2.1.0/node_modules/@ffprobe-installer/darwin-arm64

image

As you can with the picture below, shell ffprobe permission did not change with the script postinstall

I believe that it comes from pnpm v7 change: default open 「side-effects-cache」 And here is pnpm issue reference.

Solution

Add side-effects-cache=false in the .npmrc should work.

But it will let us losing some benefit of using pnpm.

SavageCore commented 1 year ago

Thanks for the issue, please try v2.1.1 and let me know how you get on!

tim80411 commented 11 months ago

@SavageCore It seems like it can not work on the inner module. But it works fine on the root project's .npmrc. Maybe we can mention this solution for pnpm users at the README.

# .npmrc
side-effects-cache=false