Skip to content

os-based-fsevents-dep#44

Open
FaaizMemonPurdue wants to merge 2 commits intomasterfrom
no-fs-deps
Open

os-based-fsevents-dep#44
FaaizMemonPurdue wants to merge 2 commits intomasterfrom
no-fs-deps

Conversation

@FaaizMemonPurdue
Copy link

Rationale

tailwindcss throws error messages on Mac (darwin) if "fsevents" not present, have to manual install it. but fsevents fails on non-Mac. avoid unsynced package.json by making it optional for non-Macs, hopefully this makes it install on Macs. Also, making things work off npm install without needing to do manual, no-save installs is nice.

Usage

just run npm install (regardless of OS), do not need to manually npm -D install tailwindcss

Changes

Non-trivial Files

package.json

Testing

  • ➕ Added units to existing tests
  • 🐣 Started a new group of tests
  • 🙅 New tests aren't needed
  • 🙋 Need help to add tests

On my Linux device, this silently skips fsevents:

faaiz@pop-os:~/GolandProjects/matcha$ npm list 
matcha@ /home/faaiz/GolandProjects/matcha
├── UNMET OPTIONAL DEPENDENCY fsevents@^2.3.2
├── live-server@1.2.2
└── tailwindcss@3.4.5
faaiz@pop-os:~/GolandProjects/matcha$ node
Welcome to Node.js v20.6.1.
Type ".help" for more information.
> const fs = require('fsevents')
Uncaught Error: Cannot find module 'fsevents'
Require stack:
- <repl>
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '<repl>' ]
}

We absolutely need a Mac to re-run npm install and test these commands do install fsevents.

Dependencies

fsevents made optional per OS

Documentation Changes

  • 📜 README.md
  • 💬 Added necessary comments to existing code
  • 🙅 no documentation needed

Issues and Bugs

If legitimate error occurs installing fsevents on mac, this may fail silently. "overrides" also might have unknown consequences

Possible Solutions

Hopefully, the tailwindcss error messages make it obvious if fsevents failed to install, at which point you can run:

npm install fsevents@^2.3.2 --no-save

Additional Notes

As far as I know, there's no generally accepted npm method to accomplish this. Running install scripts from package.json is considered an anti-pattern; there is a package to do this run-script-os, but we'd be pulling in a new dependency around selective install of a single dep.

@FaaizMemonPurdue FaaizMemonPurdue self-assigned this Jul 15, 2024
@FaaizMemonPurdue FaaizMemonPurdue changed the title no-fs-deps os-based-fsevents-dep Jul 15, 2024
@FaaizMemonPurdue
Copy link
Author

need the mac testing to confirm exactly what failure output is at each step for documentation

@FaaizMemonPurdue
Copy link
Author

testing on andrea's computer, it left the fsevents uninstalled :(

@FaaizMemonPurdue
Copy link
Author

Andrea computer running odd (maybe because conda environment) @CarlosACJ55 pls pull, ensure no package-lock.json, and run
npm install
then
npm build-css

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

Successfully merging this pull request may close these issues.

1 participant