草庐IT

javascript - 如何在Windows上构建VSCode?

coder 2024-06-14 原文

我正在尝试从源代码构建https://github.com/Microsoft/vscode,但是我不确定该怎么做。当我运行scripts\npm.bat install时,它成功完成。然后我运行了scripts\code.bat,出现了一个陌生人窗口。它是编译版本吗?它似乎无法正常工作。

如何创建完整版本?这一页:

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

  • 没有提供如何从源代码创建可执行文件。当我运行scripts\npm.bat install时会发生什么?现在,我只看到它在一些javascript文件中创建文件夹out/out-build,如下所示。这些文件是什么,我该如何处理?

    后来我尝试运行scripts\code.bat并在文件夹.build\electron上创建了一个与稳定版本大小相似的可执行文件:

    但是当我运行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.
    

    我发现了另一个问题:
  • How to build release vscode version

  • 但是我无法正确找出如何构建它。正手我想出了以下步骤来设置环境:
  • 安装NodeJSnpm。看
    教程How to Install Node.js® and NPM on Windows
  • 从cmd行运行此命令npm install --global --production windows-build-tools
    行政人员。参见npm install error - MSB3428: Could not load the Visual C++ component “VCBuild.exe”
  • 安装gulp。参见gulpjs/gulp#Getting Started


  • 重现步骤
  • git clone https://github.com/Microsoft/vscode
  • cd vscode
  • scripts\npm.bat install
  • npm run watch
  • 输出:F:\vscode>npm run watch

  • 文件 npm-debug.log :

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

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

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

    然后出现以下窗口:

    4)当我按照npm owner ls code-oss-dev错误消息的要求运行命令npm run watch时,这是输出:
    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 bugs code-oss-dev错误消息的要求运行命令npm run watch时,这是错误输出:
    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>gulp

    7)当我运行gulp compile-client-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>gulp vscode-win32-ia32

    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>gulp vscode-win32-x64

    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 run gulp -- vscode-win32-ia32

    上面的命令npm run gulp -- vscode-win32-ia32的文件 npm-debug.log

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

    F:\vscode>gulp watch --max-old-space-size=4096

    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
  • 操作系统版本:Windows 10 build 15063 x64

  • 最初发布于:Failed at the code-oss-dev@1.15.0 watch script 'gulp watch --max_old_space_size=4096'

    相关问题:
  • Development Environment Improvements (code.bat/code.sh)
  • Errors Compiling from Source on Arch Linux
  • Unable to setup vscode locally
  • Debug Batch (.bat) files
  • "JavaScript heap out of memory" when building on RHEL-7
  • Failed at the electron-mksnapshot@1.6.0 install script
  • Unhandled stream error in pipe
  • stream.js:74 throw er; // Unhandled stream error in pipe.
  • Node.js – events js 72 throw er unhandled 'error' event
  • vscode-win32-ia32 build failure: JavaScript heap out of memory
  • FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
  • npm/npm#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
  • nodejs/node#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
  • 最佳答案

    问题似乎是所使用的6.11.0的版本nodejs过时。在VSCode问题跟踪器上的问题:Failed at the code-oss-dev@1.15.0 watch script 'gulp watch --max_old_space_size=4096'中,我们可以按照以下步骤操作:

  • 安装节点7.9.0
  • git clean -xfd .
  • git pull
  • .\scripts\npm.bat install

  • 然后,如果没有错误:
  • npm run watch

  • 运行它,直到告诉您编译成功。然后:
  • .\scripts\code.bat
  • 关于javascript - 如何在Windows上构建VSCode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45162271/

    有关javascript - 如何在Windows上构建VSCode?的更多相关文章

    1. ruby - 如何在 Ruby 中顺序创建 PI - 2

      出于纯粹的兴趣,我很好奇如何按顺序创建PI,而不是在过程结果之后生成数字,而是让数字在过程本身生成时显示。如果是这种情况,那么数字可以自行产生,我可以对以前看到的数字实现垃圾收集,从而创建一个无限系列。结果只是在Pi系列之后每秒生成一个数字。这是我通过互联网筛选的结果:这是流行的计算机友好算法,类机器算法:defarccot(x,unity)xpow=unity/xn=1sign=1sum=0loopdoterm=xpow/nbreakifterm==0sum+=sign*(xpow/n)xpow/=x*xn+=2sign=-signendsumenddefcalc_pi(digits

    2. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

      我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

    3. ruby - 如何在 buildr 项目中使用 Ruby 代码? - 2

      如何在buildr项目中使用Ruby?我在很多不同的项目中使用过Ruby、JRuby、Java和Clojure。我目前正在使用我的标准Ruby开发一个模拟应用程序,我想尝试使用Clojure后端(我确实喜欢功能代码)以及JRubygui和测试套件。我还可以看到在未来的不同项目中使用Scala作为后端。我想我要为我的项目尝试一下buildr(http://buildr.apache.org/),但我注意到buildr似乎没有设置为在项目中使用JRuby代码本身!这看起来有点傻,因为该工具旨在统一通用的JVM语言并且是在ruby中构建的。除了将输出的jar包含在一个独特的、仅限ruby​​

    4. ruby - 什么是填充的 Base64 编码字符串以及如何在 ruby​​ 中生成它们? - 2

      我正在使用的第三方API的文档状态:"[O]urAPIonlyacceptspaddedBase64encodedstrings."什么是“填充的Base64编码字符串”以及如何在Ruby中生成它们。下面的代码是我第一次尝试创建转换为Base64的JSON格式数据。xa=Base64.encode64(a.to_json) 最佳答案 他们说的padding其实就是Base64本身的一部分。它是末尾的“=”和“==”。Base64将3个字节的数据包编码为4个编码字符。所以如果你的输入数据有长度n和n%3=1=>"=="末尾用于填充n%

    5. ruby-on-rails - 如何在 ruby​​ 中使用两个参数异步运行 exe? - 2

      exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby​​中使用两个参数异步运行exe吗?我已经尝试过ruby​​命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何ruby​​gems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除

    6. ruby - 如何在续集中重新加载表模式? - 2

      鉴于我有以下迁移:Sequel.migrationdoupdoalter_table:usersdoadd_column:is_admin,:default=>falseend#SequelrunsaDESCRIBEtablestatement,whenthemodelisloaded.#Atthispoint,itdoesnotknowthatusershaveais_adminflag.#Soitfails.@user=User.find(:email=>"admin@fancy-startup.example")@user.is_admin=true@user.save!ende

    7. ruby - 如何在 Ruby 中拆分参数字符串 Bash 样式? - 2

      我正在为一个项目制作一个简单的shell,我希望像在Bash中一样解析参数字符串。foobar"helloworld"fooz应该变成:["foo","bar","helloworld","fooz"]等等。到目前为止,我一直在使用CSV::parse_line,将列分隔符设置为""和.compact输出。问题是我现在必须选择是要支持单引号还是双引号。CSV不支持超过一个分隔符。Python有一个名为shlex的模块:>>>shlex.split("Test'helloworld'foo")['Test','helloworld','foo']>>>shlex.split('Test"

    8. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

      我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

    9. ruby-on-rails - 如何在 ruby​​ 交互式 shell 中有多行? - 2

      这可能是个愚蠢的问题。但是,我是一个新手......你怎么能在交互式ruby​​shell中有多行代码?好像你只能有一条长线。按回车键运行代码。无论如何我可以在不运行代码的情况下跳到下一行吗?再次抱歉,如果这是一个愚蠢的问题。谢谢。 最佳答案 这是一个例子:2.1.2:053>a=1=>12.1.2:054>b=2=>22.1.2:055>a+b=>32.1.2:056>ifa>b#Thecode‘if..."startsthedefinitionoftheconditionalstatement.2.1.2:057?>puts"f

    10. ruby-on-rails - 如何在我的 Rails 应用程序 View 中打印 ruby​​ 变量的内容? - 2

      我是一个Rails初学者,但我想从我的RailsView(html.haml文件)中查看Ruby变量的内容。我试图在ruby​​中打印出变量(认为它会在终端中出现),但没有得到任何结果。有什么建议吗?我知道Rails调试器,但更喜欢使用inspect来打印我的变量。 最佳答案 您可以在View中使用puts方法将信息输出到服务器控制台。您应该能够在View中的任何位置使用Haml执行以下操作:-puts@my_variable.inspect 关于ruby-on-rails-如何在我的R

    随机推荐