首页 > 解决方案 > 错误代码尝试从不存在的源复制

问题描述

当我在这里关注 VS 代码插件/扩展教程时,你的第一个扩展 | Visual Studio Code Extension API,我收到以下错误。

> yo code

? What type of extension do you want to create? New Extension (TypeScript)
? What's the name of your extension? HelloWorld
? What's the identifier of your extension? helloworld
? What's the description of your extension?
? Initialize a git repository? Yes
? Bundle the source code with webpack? No
? Which package manager to use? npm

Writing in C:\pg\vscode\helloworld...
Error code

Trying to copy from a source that does not exist: C:\Program Files (x86)\Nodist\bin\node_modules\generator-code\generators\app\templates\ext-command-ts/vscode

就像教程一样,我运行的命令就是

npm install -g yo generator-code
yo code

我在 Windows 10 提升的 Powershell 上。错误有什么问题以及如何解决?

标签: visual-studio-codeyeoman

解决方案


从上下文“Nodist”来看,我假设您已经在除了 node.js 实例之外的机器上安装了 Nodist。我不确定你是如何安装 node.js 的,但看起来问题的原因是你的 node.js 和 Nodist 的冲突。

也许您可以尝试卸载 Nodist 并重试,或者在不同的机器或虚拟机上尝试相同的命令?


推荐阅读