question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install Sanity dependencies on a Windows machine

See original GitHub issue

Describe the bug

It seems impossible to develop with Sanity using a Windows machine. I already reached out to Sanity on Slack, but I feel this issue deserves more visibility as I had 3 different devs with the issue on different Windows machines (all our other devs use Mac or Linux and don’t have any issues). So basically when installing dependencies using Yarn on a Windows machine (running yarn install on an existing project of our company), we get the following error:

Error: While persisting /D:/Projects/projectName/.yarn/cache/@sanity-types-npm-2.6.0-96b9f7d8b0-77d01c3bcd.zip/node_modules/@sanity/types/ -> /D:/Projects/projectName/node_modules/@sanity/portable-text-editor/node_modules/@sanity/types ENOENT: no such file or directory, mkdir 'D:\Projects\projectName\node_modules\@sanity\portable-text-editor\node_modules\@sanity\types\parts\part:@sanity'

I have validated that the issue is the : character in the D:\Projects\projectName\node_modules@sanity\portable-text-editor\node_modules@sanity\types\parts\part:@sanity file path. Windows does not allow colons in filenames.

To Reproduce

  1. Create a Sanity Studio project on Windows (we use Typescript, maybe this has an impact as well)
  2. Install dependencies using yarn install
  3. It crashes 💥

Expected behavior

We should be able to install sanity dependencies on Windows without any workaround like enabling Windows Subsystem for Linux (WSL).

Which versions of Sanity are you using?

Run sanity versions in the terminal and copy-paste the result here.

@sanity/cli             2.10.5 (latest: 2.12.2)
@sanity/base            2.10.5 (latest: 2.12.2)
@sanity/cli             2.10.5 (latest: 2.12.2)
@sanity/components       2.2.6 (up to date)
@sanity/core            2.10.5 (latest: 2.12.2)
@sanity/default-layout  2.10.5 (latest: 2.12.2)
@sanity/default-login   2.10.5 (latest: 2.11.1)
@sanity/desk-tool       2.10.5 (latest: 2.12.2)
@sanity/icons            1.1.2 (up to date)
@sanity/vision          2.10.5 (latest: 2.11.2)

What operating system are you using? Windows

Which versions of Node.js / npm are you running? Node 12, Yarn 2.4.2

Run yarn -v && node -v in the terminal and copy-paste the result here.

2.4.2
v12.20.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
leninnavacommented, Jun 17, 2022

I also got this issue on Windows recently. The only way of skipping it was using WSL.

0reactions
NathanLazocommented, Jun 18, 2022

I also got this issue on Windows recently. The only way of skipping it was using WSL.

That works prerfectly, you can also install dependencies with NPM and then run SANITY START

Read more comments on GitHub >

github_iconTop Results From Across the Web

"sanity init" command fails at "Resolving dependencies" [closed]
I solved it by installing the node_modules inside the sanity folder manually with "npm install" :).
Read more >
Does anyone get this error? Ihave... - Sanity.io community
I have had this problem for a while now and I'm not sure how to resolve it: ``` ╰─ sudo npm install -g...
Read more >
@sanity/client - npm
Start using @sanity/client in your project by running `npm i @sanity/client`. ... The client can be installed from npm:
Read more >
Build troubleshooting tips - Netlify Docs
If you are seeing your build fail with exit status 128 in the deploy log, relinking your repo using our UI is a...
Read more >
if you don't want pnpm to fail on peer dependency issues, add ...
eslint - pnpm peer dependencies auto-install - Stack Overflow ... (~/.npm/_npx/681b0a19326c4f58/node_modules/@sanity/cli/bin/sanity-cli.js:139952:7).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found