Skip to content
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

Installing wagmi with pnpm give error ERR_PNPM_PREPARE_PKG_FAILURE #1583

Closed
1 task done
francesco-gaglione opened this issue Dec 28, 2022 · 9 comments
Closed
1 task done

Comments

@francesco-gaglione
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

latest

Current Behavior

I'm trying to install wagmi with this command into a turborepo project

pnpm i wagmi --filter web

but I have this error:

apps/web                                 |  WARN  deprecated safe-event-emitter@1.0.1
apps/web                                 |  WARN  deprecated @json-rpc-tools/provider@1.7.6
apps/web                                 |  WARN  deprecated eth-sig-util@1.4.2
apps/web                                 |  WARN  deprecated @walletconnect/mobile-registry@1.4.0
apps/web                                 |  WARN  deprecated @json-rpc-tools/utils@1.7.6
apps/web                                 |  WARN  deprecated @json-rpc-tools/types@1.7.6
.                                        | +288 +++++++++++++++++++++++++++++
 ERR_PNPM_PREPARE_PKG_FAILURE  Command failed with exit code 1: npm install
Progress: resolved 520, reused 507, downloaded 0, added 0

Expected Behavior

A normal installation

Steps To Reproduce

create a turborepo project and install wagmi with pnpm

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

@sebpalluel
Copy link

sebpalluel commented Dec 28, 2022

I also have a similar issue on a Dockerfile with node:18-alpine while doing pnpm install. I'm using nx but it's not related. I'm having the same problem with the pnpm install command on Github Action.

Here is the log with this option for pnpm --reporter ndjson

#13 274.9 {"time":1672248140051,"hostname":"buildkitsandbox","pid":1,"level":"warn","name":"pnpm:package-requester","message":"Fetching github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0 failed!","prefix":"/home/node"}
#13 274.9 {"time":1672248140053,"hostname":"buildkitsandbox","pid":1,"level":"error","name":"pnpm","code":"ERR_PNPM_PREPARE_PKG_FAILURE","nam

Looking at the log and my pnpm-lock.yaml it appears @coinbase/wallet-sdk is using deprecated packages, the one causing the issue iseth-sig-util:

/eth-sig-util/1.4.2:
    resolution: {integrity: sha512-iNZ576iTOGcfllftB73cPB5AN+XUQAT/T8xzsILsghXC1o8gJUqe3RHlcDqagu+biFpYQ61KQrZZJza8eRSYqw==}
    deprecated: Deprecated in favor of '@metamask/eth-sig-util'
    dependencies:
      ethereumjs-abi: github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0
      ethereumjs-util: 5.2.1
    dev: false

@francesco-gaglione
Copy link
Author

@sebpalluel have you found a solution?

@sebpalluel
Copy link

@sebpalluel have you found a solution?

I just found a solution thanks to this post
The build is passing now on my project with this commit so it should work for you also by adding this to your package.json:

"pnpm": {
    "overrides": {
      "ethereumjs-abi": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz"
    }
  }

@jxom
Copy link
Member

jxom commented Dec 28, 2022

This was an issue with pnpm 7.20. Please upgrade to 7.21.

@jxom jxom closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2022
@sebpalluel
Copy link

This was an issue with pnpm 7.20. Please upgrade to 7.21.

FYI I still have the same issue when removing the pnpm overrides with pnpm@7.21.0:

With normal reporter: https://app.warp.dev/block/r8w9gWV8MMFOfl8PukUlb6
With reporter ndjson: https://app.warp.dev/block/UMqI342kgOeUkSL4pGyIb1

And here's the Dockerfile:

FROM node:18-alpine as deps

RUN apk add --no-cache git
## set global npm path to node user to avoid permission error when installing global packages (pnpm)
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin

USER node
WORKDIR /home/node

COPY --chown=node package.json pnpm-lock.yaml ./
RUN npm install -g pnpm@7.21.0 && pnpm install --ignore-scripts --reporter ndjson

@francesco-gaglione
Copy link
Author

francesco-gaglione commented Jan 3, 2023

@jxom same error on 7.21. Just a note, I tried on a black project on a linux envirioment and the error don't appear. Could it be a windows related error?

@francesco-gaglione
Copy link
Author

Solution found upgrading to 7.22

@sebpalluel
Copy link

Solution found upgrading to 7.22

Same here, build are now passing without the override because ethereumjs-abi is resolved correctly.

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants