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 astro (esbuild/arch linux) #5882

Closed
1 task
DrunkenToast opened this issue Jan 17, 2023 · 4 comments
Closed
1 task

Cannot install astro (esbuild/arch linux) #5882

DrunkenToast opened this issue Jan 17, 2023 · 4 comments

Comments

@DrunkenToast
Copy link

DrunkenToast commented Jan 17, 2023

What version of astro are you using?

v1.9.2

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

Npm and yarn

What operating system are you using?

(Arch) Linux

Describe the Bug

Using npm create astro@latest or manually using npm i astro fails to install astro, where astro is then not found.

~/projects
❯ npm create astro@latest

╭─────╮  Houston:
│ ◠ ◡ ◠  Initiating launch sequence... right... now!
╰─────╯

 astro   v1.9.2 Launch sequence initiated.

:heavy_check_mark: Where would you like to create your new project? … nuclear-nebula
:heavy_check_mark: How would you like to setup your new project? › a few best practices (recommended)
:heavy_check_mark: Template copied!
:heavy_check_mark: Would you like to install npm dependencies? (recommended) … yes
:heavy_check_mark: Packages installed!
:heavy_check_mark: Would you like to initialize a new git repository? (optional) … yes
:heavy_check_mark: Git repository created!
:heavy_check_mark: How would you like to setup TypeScript? › Strict
:heavy_check_mark: TypeScript settings applied!

  next   Liftoff confirmed. Explore your project!

         Enter your project directory using cd ./nuclear-nebula
         Run npm run dev to start the dev server. CTRL+C to stop.
         Add frameworks like react or tailwind using astro add.

         Stuck? Join us at https://astro.build/chat

╭─────╮  Houston:
│ ◠ ◡ ◠  Good luck out there, astronaut!
╰─────╯

~/projects took 32s
❯ cd nuclear-nebula && npm run dev

> @example/basics@0.0.1 dev
> astro dev

sh: line 1: astro: command not found

node_modules is not present in this folder indicating that installing dependencies failed.

Installing afterwards gives this error:

nuclear-nebula on  main [?] via  v18.13.0
❯ npm i
npm ERR! code 1
npm ERR! path /home/peter/projects/nuclear-nebula/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! /home/peter/projects/nuclear-nebula/node_modules/esbuild/install.js:94
npm ERR!     throw new Error(`Expected ${JSON.stringify("0.15.18")} but got ${JSON.stringify(stdout)}`);
npm ERR!           ^
npm ERR!
npm ERR! Error: Expected "0.15.18" but got "0.17.0"
npm ERR!     at validateBinaryVersion (/home/peter/projects/nuclear-nebula/node_modules/esbuild/install.js:94:11)
npm ERR!     at /home/peter/projects/nuclear-nebula/node_modules/esbuild/install.js:241: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/peter/.npm/_logs/2023-01-16T17_06_18_959Z-debug-0.log

This error happens in every environment I tried (besides with sudo which I do not want but which indicates that something is wrong with my environment).
With nvm I tried node versions: lowest compatible v16, some other v16, latest v16, latest v18 and lts.
All of them have the same issue.

In some cases I did manage to install it but then running it gave this output:

❯ npm run dev

> @example/basics@0.0.1 dev
> astro dev

  🚀  astro  v1.9.2 started in 47ms

  ┃ Local    http://localhost:3000/
  ┃ Network  use --host to expose

✘ [ERROR] Cannot start service: Host version "0.15.18" does not match binary version "0.17.1"

1 error
The service was stopped: write EPIPE

Although I haven't been able to reproduce this.

Another user, also using Arch Linux has the same issue and posted this video:
https://cdn.discordapp.com/attachments/1064581076636409866/1064696896708427806/astro.mp4

Environment information:

OS: Arch Linux x86_64
Kernel: 6.1.6-arch1-1
Shell: bash 5.1.16
DE: Plasma 5.26.5

> nvm use --lts
Now using node v18.13.0 (npm v9.3.0) (But as mentioned before multiple versions were used).

Conversation in the official Astro Discord here:
https://discord.com/channels/830184174198718474/1064581076636409866/1064581076636409866

Link to Minimal Reproducible Example

I am unsure of how to create a reproducible environment for this issue. npm create astro@latest brings up the issue on my system.

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Jan 17, 2023

Maybe you can try npm cache clean esbuild first? (or npm cache clean to clean all). After that clear node_modules and run npm install again. Perhaps the esbuild version got mixed up, but it shouldn't happen.

@DrunkenToast
Copy link
Author

That did not seem to help.

@HiDeoo
Copy link
Member

HiDeoo commented Jan 19, 2023

Is your ESBUILD_BINARY_PATH environment variable set to something? You should be able to check using env | grep ESBUILD_BINARY_PATH.

There have been reports that the esbuild Arch User Repository (AUR) package sets this variable in /etc/profile.d/esbuild.sh. Also see evanw/esbuild#2796 (comment) and evanw/esbuild#2796 (comment).

@DrunkenToast
Copy link
Author

@HiDeoo Thank you! I think this was the issue but can't be 100% certain.
I uninstalled the package where I still had an issue but I didn't reboot my pc within that time frame, so likely the variable was still set so it pointed to a wrong path. So I think this is it!

So in short, remove AUR package and make sure env is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants