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

The version of the downloaded binary is incorrect #3305

Closed
1 task done
cconsta1 opened this issue May 25, 2021 · 2 comments
Closed
1 task done

The version of the downloaded binary is incorrect #3305

cconsta1 opened this issue May 25, 2021 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@cconsta1
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi, I'm new to npm and I'm trying to use it to build a vitejs web app, where I plan to use three.js. My system is a macOS Big Sur 11.4.

The version of node is v16.2.0, npm version is 7.13.0, the yarn version is 1.22.10 and I installed things using nvm, i.e

which node returns
~/.nvm/versions/node/v16.2.0/bin/node

OK, now when I try to create a new vitejs app:

npm init @vitejs/app things go as planned and I'm able to select vanilla JavaScript. I then cd into the project and run
npm install but I get the following errors:

npm ERR! code 1
npm ERR! path ./vite-project/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The version of the downloaded binary is incorrect: spawnSync ./viteproject/node_modules/esbuild/bin/esbuild__ EACCES
npm ERR! Install unsuccessful

npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2021-05-25T19_27_24_611Z-debug.log

If I try with yarn: yarn create @vitejs/app, I'm again able to select vanilla JavaScript. If I enter the project directory and run yarn I get:

yarn install v1.22.10
warning package.json: No license field
warning ../package.json: No license field
info No lockfile found.
warning [email protected]: No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
error /Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild
Output:
The version of the downloaded binary is incorrect: spawnSync /Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/bin/esbuild__ EACCES
Install unsuccessful
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

The only difference is that with yarn, a node_modules directory is created, and esbuild is there. So, if I now try npm install it seems that things are working but running npm run dev returns the following error:

[email protected] dev
vite

/Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/bin/esbuild:2
throw new Error(`esbuild: Failed to install correctly
^

Error: esbuild: Failed to install correctly

Make sure you don't have "ignore-scripts" set to true. You can check this with
"npm config get ignore-scripts". If that returns true you can reset it back to
false using "npm config set ignore-scripts false" and then reinstall esbuild.

If you're using npm v7, make sure your package-lock.json file contains either
"lockfileVersion": 1 or the code "hasInstallScript": true. If it doesn't have
either of those, then it is likely the case that a known bug in npm v7 has
corrupted your package-lock.json file. Regenerating your package-lock.json file
should fix this issue.

at Object.<anonymous> (/Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/bin/esbuild:2:7)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47

error when starting dev server:
Error: The service was stopped
at /Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/lib/main.js:1209:25
at /Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/lib/main.js:606:9
at Socket.afterClose (/Volumes/GoogleDrive/My Drive/J/javascript/vite-project/node_modules/esbuild/lib/main.js:584:7)
at Socket.emit (node:events:377:35)
at endReadableNT (node:internal/streams/readable:1312:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

I did try to clean the cache uninstall and reinstall npm using homebrew, etc. Nothing is working. Any help will be much appreciated.

Expected Behavior

Smooth running and creation of a localhost environment

Steps To Reproduce

  1. yarn create @vitejs/app
  2. yarn
  3. yarn dev

Environment

  • OS: macOS Big Sur 11.4.
  • Node: v16.2.0
  • npm: 7.13.0
@cconsta1 cconsta1 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 25, 2021
@cconsta1 cconsta1 changed the title [BUG] <title> The version of the downloaded binary is incorrect The version of the downloaded binary is incorrect May 25, 2021
@nlf
Copy link
Contributor

nlf commented May 28, 2021

i can't reproduce this one, i was able to run npm install in the project that npm init @vitejs/app created without any issues, as well as npm run dev

do you have any additional packages in your package.json? when i ran the init command i ended up with only one devDependency on vite@^2.3.4

the EACCESS error makes me think there's a permissions issue, you might also try doing this install in a directory that's not in a Google drive as it seems like it's not playing nicely with binaries.

@cconsta1
Copy link
Author

Thank you so much!

I was able to indeed use npm in folders unrelated to my GoogleDrive account. The strange thing is that once I was able to use npm elsewhere, it started working on my GoogleDrive folders as well. I don't understand why, but it works now.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants