Unable to install Sanity dependencies on a Windows machine
See original GitHub issueDescribe 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
- Create a Sanity Studio project on Windows (we use Typescript, maybe this has an impact as well)
- Install dependencies using
yarn install
- 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:
- Created 2 years ago
- Comments:11
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