'Yarn requires Node.js 4.0 or higher to be installed. - Symfony - Docker - Yarn

I'm trying to install yarn in my symfony project, but did not succeed yet.

I installed nodejs and all needed requirements on windows. When I type node -v or yarn -v inside a windows cmd, it displays versions for the respective tools as expected.

But in my symfony project inside the container, it seems like the node and yarn commands can't be found.

Here is a screentshot of my Directory

Directory layout

When I type yarn -v or yarn install it gives the following error:

Yarn requires Node.js 4.0 or higher to be installed.

I don't know how to fix this error. Can someone point me in the right direction?



Solution 1:[1]

Yarn requires Node.js 4.0 or higher to be installed.

Currently working on Windows 8.1 and first had this issue recently when working with Gatsby and also with Rails, this issue persisted even though everything was up to date, what worked for both instances was running the CMD Line in the project directory as Administrator, then running yarn commands.

Seems to only work in the CMD Line, this was just a hunch and it worked.

Sure there is a reference but couldn't find it in the Documentation to prove the above, if anyone in future comes across the Docs, kindly link it to this post.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rails Dev