yo
yo copied to clipboard
SyntaxError: The requested module 'mem-fs' does not provide an export named 'loadFile', SyntaxError: The requested module 'mem-fs' does not provide an export named 'isFileTransform', sharedFs.pipeline is not a function
Type of issue
- Hello, I installed
yo
+generator-code
as a dev dependancies by yarn then when ever I try to runnpx yo code
in the first time I got
import { loadFile } from 'mem-fs';
^^^^^^^^
SyntaxError: The requested module 'mem-fs' does not provide an export named 'loadFile'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async pre (E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:83:3)
at async E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:193:3
- So I navigated to
mem-fs
library to export it and after export it I got the following error
file:///E:/VSCODE%20Extensions/locales%20generator/node_modules/mem-fs-editor/dist/actions/commit.js:1
import { isFileTransform } from 'mem-fs';
^^^^^^^^^^^^^^^
SyntaxError: The requested module 'mem-fs' does not provide an export named 'isFileTransform'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async pre (E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:83:3)
at async E:\VSCODE Extensions\locales generator\node_modules\yo\lib\cli.js:193:3
- So as a try I tried to remove export it because I couldn't find it in
mem-fs
so i replaced it bytrue
and the tool is running but after questions and when it comes to the last step to generate the files I got that error
Writing in E:\VSCODE Extensions\locales generator\localesgen...
Error code
sharedFs.pipeline is not a function
- Please release a new update to fix those issues
My environment
-
OS version/details:
Windows 10 64-bit
-
Node version:
20.9.0
-
yarn version:
1.22.21
-
Version of yo :
5.0.0
Expected behavior
- Just run and ask the questions then generate the files
Current behavior
- Just a collection of errors
Also tested on the following without success:
- OS: Alpine, Debian bookworm (both via docker node image), MacOs Ventura 13.6.2
- Node versions: 18.19.0, 20.9.0
- yarn versions: 1.22.21, 4.0.2
- Version of yo : 5.0.0
Switching to using npm
resolves the issue so I'm not sure why it is failing with yarn
. Not sure, but this might also be related to https://github.com/yeoman/yo/issues/800.
It's failing even with pnpm
. Again, switching to npm
resolves the issue.