Comments (5)
I think we probably just need to regenerate the package-lock.json if only platform specific packages are being installed.
It appears there's a bug in npm around this: npm/cli#4828
from stacker.news.
I am trying this approach which looks promising. I'll report back here with results.
from stacker.news.
Here's an update. Putting the following into docker-compose.override.yml
seems to have fixed the issue:
version: "3"
services:
worker:
command:
- npm install @esbuild/[email protected] --no-save --loglevel verbose && npm run worker:dev
The diff is
- npm run worker:dev
+ npm install @esbuild/[email protected] --no-save --loglevel verbose && npm run worker:dev
--no-save
is critical because this is what omits updating package.json
and package-lock.json
, meaning the git tree remains clean.
I can open a PR to make this change into docker-compose.yml
, if you think that's a good idea @huumn? I assume this is only an issue for developers not using linux locally, so @ekzyis is probably unaffected.
Thoughts? Opinions? Open to feedback :)
Edit: Another note, this is pretty hacky because the specific version 0.18.20
is required to match what's in package-lock.json
for esbuild
, otherwise the worker will fail at runtime. So if we go this route, you'd have to keep the versions in sync.
According to npm why
, we have this dependency due to tsx
:
npm why @esbuild/linux-x64
@esbuild/[email protected]
node_modules/@esbuild/linux-x64
optional @esbuild/linux-x64@"0.18.20" from [email protected]
node_modules/esbuild
esbuild@"~0.18.20" from [email protected]
node_modules/tsx
tsx@"^3.13.0" from the root project
Perhaps we could remove tsx
from our dependency tree to avoid this? Or we could invoke it via npx
e.g. npx tsx
so the deps aren't in package.json at all?
from stacker.news.
I've encountered this issue too. If you don't run npm install
locally before running sndev start
it won't create issues.
Is there a reason you install on the host before starting the environment?
The ideal solution here imo is to not share /node_modules with the host, and have npm use a non-standard location for node_modules
in the app container.
from stacker.news.
Is there a reason you install on the host before starting the environment?
Habit, I guess? I suppose it's not required for local development, then? It's definitely an oddity though because package-lock.json
indicates the darwin-arm
version of the dependencies, which I assume came from your local install (macOS on apple silicon)?
The ideal solution here imo is to not share /node_modules with the host, and have npm use a non-standard location for node_modules in the app container.
I can experiment with that. I do think there is an issue with checking in tsx
though, based on the above regarding having package-lock.json
include the platform-specific version.
Perhaps we could use npx tsx@<specific version>
to pin ourselves to the version we're currently using, to remove concern with affecting production, and also not having it represented in package-lock.json
? I can explore not sharing node_modules
, too.
from stacker.news.
Related Issues (20)
- Feature Request : Fee Credit HOT 1
- Feature Request : Custom Zaprank
- Make polls anonymous HOT 2
- Images are no longer reserving vertical space HOT 2
- Ticker in Sticky Header Does Not Inherit Changes HOT 1
- implement sndev fund_nym HOT 2
- Invalid freebie comment edits via /:id/edit
- Add popover support for markdown links to sn items `[]()`
- Search anomaly, is ":" in the title throwing something off?
- Comments non-deterministically missing after submission HOT 7
- Set a reasonable boost max HOT 1
- Can't withdraw sats to Alby Extension HOT 2
- Addition of Naira(NGN) to fiat currencies
- "Unable to get image fees" HOT 1
- Sats forwarded to anon don't go to rewards HOT 1
- Feature Request: Arrows to flip through photos HOT 2
- Prevent new account creation from /login
- Add 'This day on SN' to empty /search page
- Limited rights for "anon" account HOT 2
- Syntax highlighting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stacker.news.