PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.31k stars 358 forks source link

[BUG] Unable to install plasmo via pnpm #984

Open balub opened 4 months ago

balub commented 4 months ago

What happened?

I followed the docs and executed the following command pnpm create plasmo only to be met with the following errors.

pnpm create plasmo
🟣 Plasmo v0.86.3
🔴 The Browser Extension Framework
🟡 Extension name: demo-extension
🟡 Extension description: A basic Plasmo extension.
🟡 Author name: Plasmo Corp. <foss@plasmo.com>
🔵 INFO   | Creating new project with popup
🔵 INFO   | Installing dependencies...
 WARN  1 deprecated subdependencies found: stable@0.1.8
Packages: +589
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 667, reused 588, downloaded 0, added 589, done
node_modules/.pnpm/sharp@0.32.6/node_modules/sharp: Running install script, failed in 7.2s
.../sharp@0.32.6/node_modules/sharp install$ (node install/libvips && node install/…
│ sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.1…
│ sharp: Installation error: Request timed out
│ sharp: Please see https://sharp.pixelplumbing.com/install for required dependenci…
└─ Failed in 7.2s at /Users/********/********/********/********/demo-extension/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp
 ELIFECYCLE  Command failed with exit code 1.
🟠 WARN   | pnpm install exited with non-zero code: 1
🔵 INFO   | Initializing git project...
🟢 DONE   | Your extension is ready in:  /Users/********/********/********/********/demo-extension

    To start hacking, run:

       cd demo-extension
       pnpm dev

    Visit https://docs.plasmo.com for documentation and more examples.

Even after explicitly installing sharp by following instructions from here I still get the same error.

When I run pnpm run in the project directory, unsurprisingly it throws the following error.

> demo-extension@0.0.1 dev /Users/********/********/********/********/demo-extension
> plasmo dev

sh: plasmo: command not found
 ELIFECYCLE  Command failed.

Extra Info: node version: v20.11.0

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

pnpm create plasmo
🟣 Plasmo v0.86.3
🔴 The Browser Extension Framework
🟡 Extension name: demo-extension
🟡 Extension description: A basic Plasmo extension.
🟡 Author name: Plasmo Corp. <foss@plasmo.com>
🔵 INFO   | Creating new project with popup
🔵 INFO   | Installing dependencies...
 WARN  1 deprecated subdependencies found: stable@0.1.8
Packages: +589
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 667, reused 588, downloaded 0, added 589, done
node_modules/.pnpm/sharp@0.32.6/node_modules/sharp: Running install script, failed in 7.2s
.../sharp@0.32.6/node_modules/sharp install$ (node install/libvips && node install/…
│ sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.1…
│ sharp: Installation error: Request timed out
│ sharp: Please see https://sharp.pixelplumbing.com/install for required dependenci…
└─ Failed in 7.2s at /Users/********/********/********/********/demo-extension/node_modules/.pnpm/sharp@0.32.6/node_modules/sharp
 ELIFECYCLE  Command failed with exit code 1.
🟠 WARN   | pnpm install exited with non-zero code: 1
🔵 INFO   | Initializing git project...
🟢 DONE   | Your extension is ready in:  /Users/********/********/********/********/demo-extension

    To start hacking, run:

       cd demo-extension
       pnpm dev

    Visit https://docs.plasmo.com for documentation and more examples.

(OPTIONAL) Contribution

Code of Conduct

pavitra-infocusp commented 2 months ago

Running pnpm add plasmo seems to install the plasmo binary, however pnpm dev still doesn't work.

❯ pnpm dev

> chrome-ext-poc@0.0.1 dev /home/pavitra/Playground/chrome-ext-poc
> plasmo dev

Bus error (core dumped)
 ELIFECYCLE  Command failed with exit code 135.
Undertone0809 commented 2 months ago

I meet the same problem.

Undertone0809 commented 2 months ago

I use node v20 but failed. Using node 18 success.

15200596294git commented 1 month ago

I use node v20 but failed. Using node 18 success. May I ask which version you are using specifically? I have also encountered this issue

15200596294git commented 1 month ago

I use node v20 but failed. Using node 18 success. May I ask which version you are using specifically? I have also encountered this issue Finally, I used plasmo@0.83.0 Solved the problem