当前位置: 首页 > 知识库问答 >
问题:

如何在Windows上构建VSCode?

司马念
2023-03-14

我正在努力建造https://github.com/Microsoft/vscode 从源头上说,但我不确定该怎么办。当我运行脚本\npm.bat安装时,它成功完成。然后我运行scripts\code.bat,一个陌生的窗口出现了。它是编译版本吗?它似乎工作不正常。

如何创建完整的构建?页面:

  1. https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source

不提供如何从源代码创建可执行文件。当我运行scripts\npm.bat安装时应该发生什么?现在我只看到它在一些javascript文件中创建文件out/out build,如下所示。那些文件是什么?我用它们做什么?

后来我尝试运行脚本\code.bat,并在文件夹上创建了一个大小类似于稳定版本的可执行文件。

但是当我运行npm run watch时,这个错误被抛出:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev@1.15.0 watch: `gulp watch --max_old_space_size=4096`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the code-oss-dev@1.15.0 watch script 'gulp watch --max_old_space_size=4096'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the code-oss-dev package,
npm ERR! not with npm itself.

我发现了另一个问题:

  1. 如何构建版本vscode

但我无法正确地理解如何构建它。正手击球时,我想出了以下步骤来设置环境:

  1. 安装NodeJS和npm。请参阅如何在Windows上安装Node.js®和NPM的教程
  1. git克隆https://github.com/Microsoft/vscode
  2. cd-vscode
  3. 脚本\npm.bat安装
  4. npm跑步观察
  5. 输出:F:\vscode

文件npm-debug.log:

1) 当我第一次运行命令scripts\npm.bat install时,输出为:F:\vscode

2) 当我第一次运行命令scripts\npm.bat install时,这是输出:F:\vscode

3)当我运行命令脚本\code.bat时,这是输出:F:\vscode

此时会出现以下窗口:

4) 当我按照npm run watch错误消息的要求运行命令npm owner ls code oss dev时,输出如下:

F:\vscode>npm owner ls code-oss-dev
npm ERR! owner ls Couldn't get owner data code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "owner" "ls" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404  'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\vscode\npm-debug.log

F:\vscode>

5) 当我按照npm run watch错误消息的要求运行命令npm bugs code oss dev时,这是错误输出:

F:\vscode>npm bugs code-oss-dev
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "bugs" "code-oss-dev"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/code-oss-dev
npm ERR! 404
npm ERR! 404  'code-oss-dev' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\vscode\npm-debug.log

F:\vscode>

6) 我还运行了命令gulp,这是输出:F:\vscode

7) 当我运行命令gulpcompileclient build时,输出如下:

F:\vscode>gulp compile-client-build
[08:36:37] Using gulpfile F:\vscode\gulpfile.js
[08:36:37] Starting 'clean-client-build'...
[08:36:37] Finished 'clean-client-build' after 49 ms
[08:36:37] Starting 'compile-client-build'...
[08:36:38] Starting compilation...
[08:50:08] [monaco.d.ts] Starting monaco.d.ts generation
[08:50:12] [monaco.d.ts] Finished monaco.d.ts generation
[08:50:12] Finished compilation with 0 errors after 814540 ms
[08:50:12] Finished 'compile-client-build' after 14 min

8) 当我运行命令gulp vscode-win32-ia32时,这是错误输出:

[02:15:28] Starting 'vscode-win32-ia32'...
internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1018:11)
    at TLSWrap.onread (net.js:568:26)

F:\vscode

9)当我运行命令Gulp vscode-win32-x64时,这是错误输出:

[03:02:59] Starting 'vscode-win32-x64'...
internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1018:11)
    at TLSWrap.onread (net.js:568:26)

F:\vscode

10) 当我运行命令npm run gulp--vscode-win32-ia32时,这是错误输出:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "D:\\User\\Documents\\Nodejs\\bin\\node.exe" "D:\\User\\Documents\\Nodejs\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "gulp" "--" "vscode-win32-ia32"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! code-oss-dev@1.15.0 gulp: `gulp --max_old_space_size=4096 "vscode-win32-ia32"`
npm ERR! Exit status 3

F:\vscode

文件npm-debug.log的命令npm run gup--vscode-win32-ia32就在上面。

11) 当我运行命令“gulp watch--max old space size=4096”时,这是输出,程序挂起在这一行:

F:\vscode

npm版本

F:\vscode>npm --version
3.10.10

F:\vscode>node --version
v6.11.0

F:\vscode>ver
Microsoft Windows [Version 10.0.15063]

F:\vscode>python --version
Python 2.7.13 :: Continuum Analytics, Inc.
  • VSCode版本:code-oss-dev@1.15.0
  • OS版本:Windows 10 build 15063 x64

最初发布日期:在代码oss处失败-dev@1.15.0手表脚本“大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口

相关问题:

  1. 开发环境改进(code.bat/code.sh)

共有2个答案

戚俊健
2023-03-14

当我尝试按照说明操作时,我得到:

gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\code\vscode\node_modules\native-watchdog

不知道为什么,但似乎node gyp找不到visual studio。

澹台宾白
2023-03-14

问题似乎是使用的nodejs的过时版本6.11.0。问题来源:代码oss失败-dev@1.15.0在VSCode问题跟踪器上查看脚本“gulp watch--max_old_space_size=4096”,我们可以按照以下步骤操作:

  1. 安装节点7.9.0
  2. git clean-xfd.
  3. git pull
  4. \scripts\npm.bat安装

然后,如果没有错误:

  1. npm运行观察

运行它,直到它告诉您编译成功。然后:

  1. \scripts\code.bat
 类似资料:
  • 问题内容: 我想在Windows上构建静态库(* .LIB文件)GNU libiconv ,以与Visual C ++中的其他库一起使用。我正在使用的其他库是使用“多线程DLL”(/ MD)运行时选项构建的。因此,我需要使用相同的选项来构建libiconv。 问题是使用GNU构建系统,我想使用/ MD选项进行编译。您可以在此处查看libiconv的源结构:http ://cvs.savannah.

  • 我已安装: Windows系统 JDK 1.8 Maven 3.0或更高版本 ProtocolBuffer 2.5.0 CMake 3.2 Windows SDK 7.1 首次生成的Internet连接(获取所有Maven和Hadoop依赖项) gnuwin32和Git以获取诸如sh之类的指令... From building.txt:“UNIX命令行工具也包含在Windows Git包中,可以从

  • 如果你安装了 Microsoft Visual C++。SCons 将会自动地检测到并使用。如果你没有的话你可以下载免费的 Visual C++ Toolkit 和 Platform SDK。构建系统并不会自动地认出这些工具包,所以你要做一些额外的工作: scons MSTOOLKIT=yes 如果你得到关于编译器的错误或找不到 Platform SDK,使用: set MSSDK=C:\Pa

  • 问题内容: 我正在尝试在Windows 64位计算机上为Python 2.7构建lxml。我找不到适用于Python 2.7版本的lxml egg。因此,我正在从源代码进行编译。我正在按照此网站上的说明进行操作 http://lxml.de/build.html 在静态链接部分下。我遇到错误 谁能帮我这个?我尝试将路径设置为具有Microsoft Visual Studio ..我可以从命令行运行

  • 问题内容: 我有一个Java应用程序的Maven构建,可以通过键入相同的命令在Linux或Windows上成功运行。 然而,使用Jenkinsfile方法设置此生成,在Linux上文件需要包含和Windows 。 如果在Windows上正确配置了路径和工具,则日志显示: 有没有办法让单个Jenkinsfile允许在两种环境中构建? 问题答案: 管道脚本可以包含常规代码,因此允许分支。您可以使用并根

  • 我已经为android平台开发了一个phonegap项目,该项目已经完成。现在,我想为windows平台创建一个相同项目的构建。因此,我遵循以下链接以供参考,http://docs.phonegap.com/en/2.3.0/guide_getting-started_windows-phone-8_index.md.html但我还是遇到了一些问题。 我的规范、Windows-7操作系统、cord