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

Error during bun install: Unexpected Token '=' #156

Open
netwolfx opened this issue Feb 19, 2025 · 5 comments
Open

Error during bun install: Unexpected Token '=' #156

netwolfx opened this issue Feb 19, 2025 · 5 comments
Labels
macos Platform: macOS

Comments

@netwolfx
Copy link

Encountered an error during pre-requisites install using bun.

From sterr:

❯ bun install
bun install v1.2.2 (c1708ea6)

$ husky
(node:13135) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/jlegel/Downloads/amazon-kindle-bulk-downloader-main/node_modules/husky/bin.js:14
        ;(o.scripts ||= {}).prepare = 'husky'
                      ^

SyntaxError: Unexpected token '='
    at Loader.moduleStrategy (internal/modules/esm/translators.js:88:18)
    at async link (internal/modules/esm/module_job.js:41:21)
error: prepare script from "amazon-kindle-bulk-downloader" exited with 1
@netwolfx
Copy link
Author

Environment:
Intel Macbook
MacOS 15.3.1
shell zsh

@treetrum
Copy link
Owner

It looks like this is failing in the postinstall step rather than the actual install step. Whilst not ideal, this could still work. Have you tried running the tool after this to see if it still works?

@treetrum
Copy link
Owner

I've also just pushed up a potential fix for this one in 714f33a

Can you pull the latest and try again?

@inlikealion inlikealion added the macos Platform: macOS label Feb 20, 2025
@netwolfx
Copy link
Author

Thank you for the suggestion. I pulled a fresh copy of the code and ran it again, and am now getting a new error:

❯ bun install
bun install v1.2.2 (c1708ea6)
  ⚙️  puppeteer [1/1] (node:13915) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/jlegel/Downloads/amazon-kindle-bulk-downloader-main/node_modules/puppeteer/install.mjs:39
  const {downloadBrowsers} = await importInstaller();
                             ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:88:18)
    at async link (internal/modules/esm/module_job.js:41:21)

error: postinstall script from "puppeteer" exited with 1

Running bun install again yields the same error as before, with the unexpected token '='

@rycaut
Copy link

rycaut commented Feb 22, 2025

I'm getting the same error (well similar) mine says:

error: script "start" exited with code 1
shannonclark@Shannons-MacBook-Pro amazon-kindle-bulk-downloader % bun install
bun install v1.2.3 (8c4d3ff8)

$ husky
file:///Users/shannonclark/amazon-kindle-bulk-downloader/node_modules/husky/bin.js:14
;(o.scripts ||= {}).prepare = 'husky'
^^^

SyntaxError: Unexpected token '||='
at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
at async link (internal/modules/esm/module_job.js:47:21)
error: prepare script from "amazon-kindle-bulk-downloader" exited with 1

MacOS with a freshly installed bun and had no issues doing a git clone but now can't seem to install (and trying to run without the install fails in other ways)

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

No branches or pull requests

4 participants