cloudflare / templates

A collection of starter templates and examples for Cloudflare Workers and Pages
https://cloudflareworkers.com
MIT License
1k stars 638 forks source link

Error: EXDEV: cross-device link not permitted #146

Closed appellation closed 1 year ago

appellation commented 1 year ago

Hello! I'm attempting to use the recommended template generation steps outlined in the readme, but I'm encountering the EXDEV: cross-device link not permitted error when I try to generate the template on a drive that isn't my main drive. I'm not sure if this is a limitation of these package managers or an issue that can be resolved in this project.

❯ yarn create cloudflare test worker-rust
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-cloudflare@1.0.0" with binaries:
      - create-cloudflare
[#####] 5/5
Error: EXDEV: cross-device link not permitted, rename 'C:\Users\nelso\AppData\Local\Temp\4098c0fb8a35c-307be99e697fa\worker-rust' -> 'D:\dev\test'

error Command failed.
Exit code: 1
Command: C:\Users\nelso\AppData\Local\Yarn\bin\create-cloudflare
Arguments: test worker-rust
Directory: D:\dev
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Thanks!

benhansen-io commented 1 year ago

Can be worked around by overriding the temp dir to a location on the same device. For example:

mkdir ~/tmp
TMPDIR=~/tmp yarn create cloudflare my-project worker-rust
JacobMGEvans commented 1 year ago

Thank you @appellation for the issue and @benhansen-io for your follow up. For future individuals finding this ticket: The suggested method of creating a project from a template is now using wrangler generate for additional information: https://developers.cloudflare.com/workers/wrangler/commands/#generate

The templates have also been moved into the workers-sdk monorepo, here: https://github.com/cloudflare/workers-sdk/tree/main/templates