orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
3.68k stars 388 forks source link

[Bug]: pnpm required using yarn #548

Closed drafenous closed 1 year ago

drafenous commented 1 year ago

Expected Behavior

When I try to install using: yarn add vanilla-cookieconsent@next just install the package.

Current Behavior

When i run yarn add vanilla-cookieconsent@next for angular, i got an error:

error /home/rodrigo/Projetos/spartacus/node_modules/vanilla-cookieconsent: Command failed.
Exit code: 1
Command: npx only-allow pnpm
Arguments: 
Directory: /home/rodrigo/Projetos/spartacus/node_modules/vanilla-cookieconsent
Output:
npx: instalou 20 em 6.565s
╔═════════════════════════════════════════════════════════════╗
║                                                             ║
║   Use "pnpm install" for installation in this project.      ║
║                                                             ║
║   If you don't have pnpm, install it via "npm i -g pnpm".   ║
║   For more details, go to https://pnpm.js.org/              ║
║                                                             ║
╚═════════════════════════════════════════════════════════════╝

I dont have how to install pnpm, because my project require an old version of node: v12.22.1, and pnpm requires v16.14 when i run npm i -g pnpm i tried to use yarn, like yarn add -g pnpm, because my project uses yarn by default, but doesnt work.

I tried to use a old version (2.8.8) of the plugin, but i got this error: Property 'run' does not exist on type 'typeof import("/home/rodrigo/Projetos/spartacus/node_modules/vanilla-cookieconsent/types/types")'.ts(2339)

Steps to reproduce

Use Yarn. Use and old version of node, like v12.22.1 Try to run yarn add vanilla-cookieconsent@next

Proposed fix or additional info.

Angular version: 10.2.4

Version

@next

On which browser do you see the issue?

No response

orestbida commented 1 year ago

Looks like this is an issue with https://github.com/pnpm/pnpm/issues/4278#issuecomment-1490433166.

For now the only solution is to remove the preinstall script from package.json: https://github.com/orestbida/cookieconsent/blob/4a41bf263d267a836215df2f9e367cb06ff28662/package.json#L13

drafenous commented 1 year ago

Looks like this is an issue with pnpm/pnpm#4278 (comment).

For now the only solution is to remove the preinstall script from package.json:

https://github.com/orestbida/cookieconsent/blob/4a41bf263d267a836215df2f9e367cb06ff28662/package.json#L13

Thanks! you're amazing! :) It's working fine now.