Installing volto from packages, node version question

I'm trying to install Plone 6 from packages on Windows and for reasons beyond my control I am unable to use WSL on my company provided PC (so no Make, so no cookiecutter). I've successfully got the backend running with pip (no zc.buildout), mxdev, and some Zope utilities, and I'll share my experience there in another post if people are interested. I'm not clear what cookiecutter is doing but the latest training bootstraps a project with

@plone/generator-volto. So I installed yaoman and yarn@3 and tried to run @plone/volto:

(venv) PS C:\Users\wohnlice\PycharmProjects\Plone6> npm install -g yo @plone/generator-volto
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@plone/generator-volto@6.3.0',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || ^16' },
npm WARN EBADENGINE   current: { node: 'v18.15.0', npm: '9.5.0' }

Obviously this says it requires node 12, 14, or 16 and I'm on 18. So my question is, do I need to fallback to Node 16 or is there a replacement for @plone/generator-volto I should be using? Just in case this is only a warning, I did try to use it node 18 anyway:

(venv) PS C:\Users\wohnlice\PycharmProjects\Plone6> yo @plone/volto                         
Getting latest Volto version
Using latest released Volto version: 16.17.1
Retrieving Volto's yarn.lock
? Project name (e.g. my-volto-project) my-volto
? Would you like to add addons? false
      throw er; // Unhandled 'error' event

Error: ENOENT: no such file or directory, scandir 'C:\Users\wohnlice\PycharmProjects\Plone6\my-volto\package.json.tpl'
    at Object.readdirSync (node:fs:1452:3)
    at exports.readdir (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\sync\fs.js:18:20)
    at Object.safeCall [as safe] (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\call.js:24:8)
    at DirectoryReader.readNextDirectory (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\directory-reader.js:78:10)
    at (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\directory-reader.js:57:18)
    at (node:internal/streams/readable:496:12)
    at readdirSync (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\sync\index.js:27:21)
    at Function.readdirSyncStat (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\@mrmlnc\readdir-enhanced\lib\index.js:34:10)
    at ReaderSync.dynamicApi (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\fast-glob\out\providers\reader-sync.js:64:24)
    at ReaderSync.api (C:\Users\wohnlice\AppData\Roaming\npm\node_modules\@plone\generator-volto\node_modules\fast-glob\out\providers\reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  syscall: 'scandir',
  code: 'ENOENT',
  path: 'C:\\Users\\wohnlice\\PycharmProjects\\Plone6\\my-volto\\package.json.tpl'

Node.js v18.15.0
(venv) PS C:\Users\wohnlice\PycharmProjects\Plone6> yarn -v

I did also try in yarn classic 1.x in case @plone/generator-volto is older and that didn't make a difference.

By the way, the instructions for installing yarn@3 here Install Plone from its packages – Install — Plone Documentation v6.0 did not work for me. This may be because I'm on node 18 not node 16, but the yarn installation guide recommends to install with corepack not npm, and that did work.

shows the engines as 16 or 18.

Try to install the latest generator, 7.0.0-alpha.2

Please note that, as far as we know, Volto doesn't run on Windows. None of the core developers have tried it or tried to run it, so you'll likely get into more problems.

To save yourself some time, make a git clone of plone/volto and try to run it directly from there (yarn + yarn start). Then you'll at least avoid the problem of generating the project, if Volto won't run at all.

Thanks, I was about to install it with npm install -g @plone/generator-volto@7.0.0-alpha.2 but indeed I did get an error running yo @plone/volto. The generated log file says

# This file contains the result of Yarn building a package (my-volto@workspace:.)
# Script name: postinstall

'make' is not recognized as an internal or external command,
operable program or batch file.
command not found: make

Damn. I'll have to look into this to see if there's an easy fix. I did one for Zope2 to make mkwsgiinstance work in Windows already. For what it's worth, I was able to get Volto running in a Windows environment just fine at some point maybe a year or so ago. That was long enough that I was on node 16, yarn 1, and who knows what version of @plone/volto. But perhaps a Windows version isn't too far out of the realm of possibility still.

I've added a ticket Volto is unable to run on Windows · Issue #4564 · plone/volto · GitHub

Maybe at least the make patches command could be rewritten not to depend on make. The problem make solves is that there's a ton of flavours of commands that need to be run, they were all stashed as scripts in the package.json, so it was hard to document them (with make you can do make help).

1 Like

I feel that. I think zc.buildout really did two things, (1) managed python packages and (2) built config files, executables, etc. It wasn't very good at 1 and moving to just python venvs feels much better. But I think it did 2 very well, and allowed things to be built OS-agnostic. So you end up needing some kind of shell script or makefile.