In the attached image, you can see I am setting up source and base helper functions and attmpting to run the fmt-check command in my repo. However, whenever it goes to run it, I am getting the error in the second screenshot which seems like the install command from base didn't actually run a yarn install?
#Install node working official Dagger Node module
1 messages · Page 1 of 1 (latest)
Any chance this is already a known issue that has been reported as an issue on Github I can sub too?
What's your node dependency version?
Sorry, not sure I follow the question. Like which version are you looking for specifically?
In dagger.json, you must have a dependency on "node". I'm asking for the full reference so I can inspect its source code.
{
"name": "motion-dagger",
"sdk": "typescript",
"dependencies": [
{
"name": "node",
"source": "github.com/dagger/dagger/sdk/typescript/dev/node@fca9e788f6d605ef9d256beace4656c11d7f6fe5"
}
],
"source": "dagger",
"engineVersion": "v0.10.1"
}
At the time I pulled this in, it was the most recent version
Can you add --debug in dagger --debug call?
Yeah, Ive gotta get my repo back into this state. It'll be a few
Hmm... I think this line is problematic: https://github.com/dagger/dagger/blob/aee4b845fc1a5b24446c81e5a733b0947a4b66a0/sdk/typescript/dev/node/src/index.ts#L42
Try passing an explicit cache volume, but uniquely named for this module/source code:
.withSource(this.source(), dag.cacheVolume("motion-ci-node-modules"))
Im not sure what changed since I ran into this issue the other day, but it seems like it's running yarn install properly now... Im guessing that cache volume though would help with speed?
Yes, the problem is the name of the cache volume. If you use this node module in two different code bases, they'll share the same "node_modules" directory because the cache volume has such a generic name ("node-modules").
A cache volume for node modules needs to have a cache key that's very specific to a source code.
You wouldn't copy a node_modules directory from one project to another.
So if you use this dag.node() module in other places, that's no bueno 🙂 Could even be from following a tutorial using the same cache volume name. Better pass one yourself explicitly here.
Makes sense. I think for now, I'll close out this thread. I've got about 1000 other questions, but those will come later when I get further along. Hah.
👍
\cc @signal wagon 👆