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

Unable to run local dev preview on Linux #2142

Closed
hnrkndrssn opened this issue Jan 25, 2024 · 3 comments
Closed

Unable to run local dev preview on Linux #2142

hnrkndrssn opened this issue Jan 25, 2024 · 3 comments
Assignees

Comments

@hnrkndrssn
Copy link
Contributor

Following the instructions here fails when running pnpm dev with the following error:

> pnpm dev

> @octopus/[email protected] dev /home/henrik/code/octopusdeploy/docs
> node --no-experimental-fetch ./src/themes/accelerator/utilities/img.mjs && astro dev

/home/henrik/code/octopusdeploy/docs/node_modules/.pnpm/[email protected]/node_modules/sharp/lib/sharp.js:107
  throw new Error(help.join('\n'));
        ^

Error: Could not load the "sharp" module using the linux-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
    npm install --force @img/sharp-linux-x64
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/home/henrik/code/octopusdeploy/docs/node_modules/.pnpm/[email protected]/node_modules/sharp/lib/sharp.js:107:9)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/home/henrik/code/octopusdeploy/docs/node_modules/.pnpm/[email protected]/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)

Node.js v18.15.0
 ELIFECYCLE  Command failed with exit code 1.

node/npm/pnpm info:

> node -v
v18.15.0
> npm -v
9.5.0
> pnpm -v
8.11.0

Linux distribution info:

> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
@hnrkndrssn
Copy link
Contributor Author

I have found a workaround. Running the following commands allow me to start the dev server for the docs.

pnpm install --include=optional sharp
pnpm install --force @img/sharp-linux-x64

@steve-fenton-octopus
Copy link
Contributor

Thanks for letting us know @hnrkndrssn

It looks like your workaround is the best way to handle this. It's because Sharp depends on some graphics APIs that differ per OS. I think we'll add a note to the README to help the next person get up and running.

@steve-fenton-octopus steve-fenton-octopus self-assigned this Jan 31, 2024
@steve-fenton-octopus
Copy link
Contributor

A note has been added to this section of the README.

https://github.com/OctopusDeploy/docs?tab=readme-ov-file#deploying-to-preview-environment-octopus-developers

Let me know if you think it could be improved.

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

2 participants