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

Fix for Installing Chainlit on ARM Macs #1728

Open
ishaansehgal99 opened this issue Jan 16, 2025 · 2 comments
Open

Fix for Installing Chainlit on ARM Macs #1728

ishaansehgal99 opened this issue Jan 16, 2025 · 2 comments
Labels
bug Something isn't working dev-tooling Relating to developer/contributor toolings. needs-triage

Comments

@ishaansehgal99
Copy link
Contributor

Describe the bug
Bug arises on M3 Pro max mac - during installation of Chainlit project following first step of CONTRIBUTING.md

poetry install --with tests --with mypy --with dev
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: chainlit (2.0.3)Preparing build environment with build-system requirements poetry-core==1.9.1

-- Building frontend, this might take a while!

   If you don't need to build the frontend and just want dependencies installed, use:
   `poetry install --no-root`

-- Running: /Users/ishaansehgal/Library/pnpm/pnpm install --frozen-lockfile
Scope: all 4 workspace projects
Already up to date
Done in 60ms
-- Running: /Users/ishaansehgal/Library/pnpm/pnpm buildUi

> @ buildUi /Users/ishaansehgal/Documents/chainlit
> cd libs/react-client && pnpm run build && cd ../copilot && pnpm run build && cd ../../frontend && pnpm run build


> @chainlit/[email protected] build /Users/ishaansehgal/Documents/chainlit/libs/react-client
> tsup src/index.ts --clean --format esm,cjs --dts  --external react --external recoil --minify --sourcemap --treeshake

Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/Users/ishaansehgal/Documents/chainlit/libs/react-client/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/Users/ishaansehgal/Documents/chainlit/libs/react-client/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:68:76)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/Users/ishaansehgal/Documents/chainlit/libs/react-client/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/shared/parseAst.js:12:19)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Solution is after cloning to do
rm -rf node_modules
rm -rf libs/*/node_modules
rm -rf frontend/node_modules

# Remove lock files
rm -rf pnpm-lock.yaml
rm -rf package-lock.json
rm -rf yarn.lock


pnpm store prune
pnpm cache delete

Install a specific version of Rollup that's known to work with M1/M2 Macs:
pnpm add -D [email protected]

# Try building again
pnpm install
pnpm buildUi

Screenshots

Image
@dosubot dosubot bot added bug Something isn't working dev-tooling Relating to developer/contributor toolings. labels Jan 16, 2025
@dokterbob
Copy link
Collaborator

Thanks for the feedback @ishaansehgal99. Could you provide a reference to which version(s) of rollup will or will not work? We can upgrade the deps and/or are happy to accept a PR.

@ishaansehgal99
Copy link
Contributor Author

Hey @dokterbob here is a PR link! :) #1752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev-tooling Relating to developer/contributor toolings. needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants