I'm trying to make a custom extension in vscode, but every time I run the command yo code (from the vscode tutorial) I get the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'stream' imported from C:\Users\{username}\AppData\Roaming\npm\node_modules\yo\node_modules\mem-fs\dist\index.js
at packageResolve (internal/modules/esm/resolve.js:655:9)
at moduleResolve (internal/modules/esm/resolve.js:696:18)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
at Loader.resolve (internal/modules/esm/loader.js:88:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:241:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:56:40)
at link (internal/modules/esm/module_job.js:55:36)
Even when I followed the steps from the yoeman guide I get the same error. I'm not very familiar with node or npm sop I don't know what to search for or do.
Additional information:
OS: Windows 11
Terminal: Powershell
Generator Location: C:\Users\{username}\AppData\Roaming\npm\node_modules\generator-code
Happy to provide any more inmformation required.
I've tried running it from multiple drives, reinstalling the package, and tying it with another generator.
1 Answer 1
I just tried the notes for writing your first extension also. What I did was to update (reinstall) node.js from the node site. reran yo code and received PS C:\Users{user}> yo code
_-----_ ╭──────────────────────────╮
| | │ Welcome to the Visual │
|--(o)--| │ Studio Code Extension │
--------- ́ │ generator! │ ( _ ́U_ ) ╰──────────────────────────╯
/A\ /
| ~ |
'._.'__
́ |° ́ Y
? What type of extension do you want to create? (Use arrow keys)
❯ New Extension (TypeScript)
New Extension (JavaScript)
New Color Theme
New Language Support
New Code Snippets
New Keymap
New Extension Pack
New Language Pack (Localization)
New Web Extension (TypeScript)
New Notebook Renderer (TypeScript)
Comments
Explore related questions
See similar questions with these tags.