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

Cannot install vitest 0.27.1 #2678

Closed
fruddq opened this issue Jan 16, 2023 · 5 comments
Closed

Cannot install vitest 0.27.1 #2678

fruddq opened this issue Jan 16, 2023 · 5 comments
Labels

Comments

@fruddq
Copy link

fruddq commented Jan 16, 2023

Describe the bug

Cannot install latest vitest.

Reproduction

❯ node -v
v18.13.0

❯ npm init -y
Wrote to /tmp/projectTest/package.json:

{
  "name": "projecttest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "esbuild": "^0.17.0",
    "vitest": "^0.27.1"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

❯ pnpm i [email protected] -D
Packages: +51
+++++++++++++++++++++++++++++++++++++++++++++++++++
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, failed in 107ms
.../[email protected]/node_modules/esbuild postinstall$ node install.js
│ /tmp/projectTest/node_modules/.pnpm/[email protected]/node_modules/esbuild/install.js:130
│     throw new Error(`Expected ${JSON.stringify("0.16.17")} but got ${JSON.stringify(stdout)}`);
│           ^
│ Error: Expected "0.16.17" but got "0.17.0"at validateBinaryVersion (/tmp/projectTest/node_modules/.pnpm/[email protected]/node_modules/esbuild/install.js:130:11)
│     at /tmp/projectTest/node_modules/.pnpm/[email protected]/node_modules/esbuild/install.js:281:5
│ Node.js v18.13.0
└─ Failed in 108ms at /tmp/projectTest/node_modules/.pnpm/[email protected]/node_modules/esbuild
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 109ms
 ELIFECYCLE  Command failed with exit code 1.
Progress: resolved 94, reused 51, downloaded 0, added 0

System Info

❯ npx envinfo --system --npmPackages '{vitest,vite,@vitejs/*}' --binaries --browsers
Need to install the following packages:
  [email protected]
Ok to proceed? (y) y

  System:
    OS: Linux 6.1 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 8.23 GB / 15.53 GB
    Container: Yes
    Shell: 3.5.1 - /bin/fish
  Binaries:
    Node: 18.13.0 - ~/.asdf/installs/nodejs/lts/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.3 - ~/.asdf/plugins/nodejs/shims/npm
  Browsers:
    Firefox: 108.0.2
  npmPackages:
    vitest: ^0.27.1 => 0.27.1 


### Used Package Manager

pnpm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@beckend
Copy link

beckend commented Jan 16, 2023

I have the same thing with npm:

$ npm i -D vitest
npm ERR! code 1
npm ERR! path /tmp/dsadsadas/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! /tmp/dsadsadas/node_modules/esbuild/install.js:130
npm ERR!     throw new Error(`Expected ${JSON.stringify("0.16.17")} but got ${JSON.stringify(stdout)}`);
npm ERR!           ^
npm ERR!
npm ERR! Error: Expected "0.16.17" but got "0.17.0"
npm ERR!     at validateBinaryVersion (/tmp/dsadsadas/node_modules/esbuild/install.js:130:11)
npm ERR!     at /tmp/dsadsadas/node_modules/esbuild/install.js:281:5
npm ERR!
npm ERR! Node.js v18.13.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/admin/.npm/_logs/2023-01-16T08_11_45_643Z-debug-0.log

@sheremet-va
Copy link
Member

It feels like a esbuild issue, and not Vitest? Vitest doesn't even define esbuild version, Vite does.

@beckend
Copy link

beckend commented Jan 16, 2023

You are probably right, installed vite failed with the same error.

@beckend
Copy link

beckend commented Jan 16, 2023

But this also means that we cannot install vitest now.

@beckend
Copy link

beckend commented Jan 25, 2023

Found the solution here: evanw/esbuild#2865

export ESBUILD_BINARY_PATH=
npm i

@fruddq fruddq closed this as completed Jan 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants