pnpm / action-setup

Install pnpm package manager
https://github.com/marketplace/actions/setup-pnpm
MIT License
899 stars 87 forks source link

The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary. #79

Open Kolobok12309 opened 1 year ago

Kolobok12309 commented 1 year ago

This error we have while trying installing dependencies with ts build (dependency is another repo with prepare script) by this action.

The inferred type of "X" cannot be named without a reference to "Y". This is likely not portable. A type annotation is necessary.

Locally or on self-hosted runner all be fine. I try add node-linker=hoisted or auto-install-peers = true and error still exists.

But on our runner pnpm has another store directory (pnpm installed by npm install -g pnpm@7)

// self-host runner
/home/{user}/.local/share/pnpm/store/v3`

// cloud runner with this action
/home/runner/setup-pnpm/node_modules/.bin/store/v3

And after changing store directory to same as self-host runner, the error is gone

- name: Install pnpm
   uses: pnpm/action-setup@v2
   with:
    version: 7

- name: Create store dir
   run: mkdir -p ~/.local/share/pnpm/store/v3

- name: Reassign store dir
   run: pnpm config set store-dir ~/.local/share/pnpm/store/v3

I don't know where this error, mb because path of runner contain node_modules or something else. Hope this helps someone else