moodle / moodle/devdocs

The Yarn setup does not work on Windows

Open
#391 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted repo
Dominant language
TypeScript
Stars
74
Forks
652
Avg merge
2d 50m
Merged PRs (30d)
12

Description

What is the issue that you're experiencing?

I am trying to follow the instructions on https://moodledev.io/general/documentation/installation so I can contribute to devdocs from my normal Work laptop, which is Windows 10.

Unfortunately, the instrcutions at https://moodledev.io/general/documentation/installation#local-development don't work.

I re-tested using a clean checkout. Based on https://phoenixnap.com/kb/yarn-windows I tried a powershell windows running as Admin, having previously tried in a git-bash terminal They both fail in a similar way.

PS C:\Users\tjh238\workspace> git clone git@github.com:moodle/devdocs.git devdocs-test
Cloning into 'devdocs-test'...
remote: Enumerating objects: 146468, done.
remote: Counting objects: 100% (804/804), done.
remote: Compressing objects: 100% (336/336), done.
remote: Total 146468 (delta 467), reused 728 (delta 447), pack-reused 145664
Receiving objects: 100% (146468/146468), 232.68 MiB | 7.72 MiB/s, done.
Resolving deltas: 100% (125433/125433), done.
Checking out files: 100% (1001/1001), done.
PS C:\Users\tjh238\workspace> cd .\devdocs-test\
PS C:\Users\tjh238\workspace\devdocs-test> nvm install
Invalid version.

[SNIP standard nvm help]

Note, Windows NVM is different from linux one, so this does not work. Anyway, I already have Node from Moodle etc.

PS C:\Users\tjh238\workspace\devdocs-test> node -v
v16.14.0

Installing Yarn seems fine, except that I had alrady done it before, so had to force it:

PS C:\Users\tjh238\workspace\devdocs-test> npm i -g yarn
npm ERR! code EEXIST
npm ERR! path C:\tools\nvm\v16.14.0\yarn.cmd
npm ERR! EEXIST: file already exists
npm ERR! File exists: C:\tools\nvm\v16.14.0\yarn.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tjh238\AppData\Local\npm-cache\_logs\2022-10-17T11_30_33_289Z-debug-0.log
PS C:\Users\tjh238\workspace\devdocs-test> npm i -g yarn --force
npm WARN using --force Recommended protections disabled.

added 1 package, and audited 3 packages in 1s

found 0 vulnerabilities
npm notice
npm notice New minor version of npm available! 8.3.1 -> 8.19.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.2
npm notice Run npm install -g npm@8.19.2 to update!
npm notice

Then problem comes when you try to use yard:

PS C:\Users\tjh238\workspace\devdocs-test> yarn
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

(Note: there is nothing wrong with my network connction. It is just an unhelpful error.)

I spent a bit of time at Global Moot DevJam trying to debug this with Sara, but it is all a black box, so I don't know what is wrong.

Note: other people think yarn works on Windows (e.g. https://phoenixnap.com/kb/yarn-windows#ftoc-heading-4 - with the same install instructions) so I don't know why this is failing.

Are you able to provide a patch for this?

If I can help fix this, I will, but I don't know where to start.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the local-development section of the installation documentation and reproduce the reported commands in a clean checkout on Windows 10. Investigate the nvm and Yarn steps around nvm install and yarn; the documentation is done when a Windows contributor can complete the setup without the reported version and network errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, powershell
Domain
documentation, tooling
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.