3

I am trying to build https://github.com/Microsoft/vscode from the source, but I am not sure exactly what to do. When I ran scripts\npm.bat install, it completed successfully. Then I ran scripts\code.bat and a stranger window showed up. It is it the compiled version? It did not seem to work correctly.

image

How can I create full build? The page:

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

Does not offered how to create an executable from the source. When I run scripts\npm.bat install what should happen? For now I only see it create the folder out/out-build within some javascript files, as showed bellow. What are those files and what I do with them?

image

Later I tried to ran the scripts\code.bat and created an executable similar in size to the stable version on the folder .build\electron:

image

But when I ran npm run watch, this error is throw:

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.

I found the other question:

  1. How to build release vscode version

But I could not figure it out correctly how to build it. Forehand I figured out the following steps to setup the environment:

  1. Install NodeJS and npm. See the tutorial How to Install Node.js® and NPM on Windows
  2. Run this command npm install --global --production windows-build-tools from cmd line as Administrator. See npm install error - MSB3428: Could not load the Visual C++ component “VCBuild.exe”
  3. Install gulp. See gulpjs/gulp#Getting Started

Steps to Reproduce

  1. git clone https://github.com/Microsoft/vscode
  2. cd vscode
  3. scripts\npm.bat install
  4. npm run watch
  5. Outputs: F:\vscode>npm run watch

File npm-debug.log:

1) When I ran the command scripts\npm.bat install for the first time, this was the output: F:\vscode>scripts\npm.bat install

2) When I ran the command scripts\npm.bat install for the after the first time, this was the output: F:\vscode>scripts\npm.bat install

3) When I ran the command scripts\code.bat, this was the output: F:\vscode>scripts\code.bat

And the following window showed up:

image

4) When I ran the command npm owner ls code-oss-dev as asked by the npm run watch error message, this was the output:

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) When I ran the command npm bugs code-oss-dev as asked by the npm run watch error message, this was the error output:

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) I also ran the command gulp, this was the output: F:\vscode>gulp

7) When I ran the command gulp compile-client-build, this was the output:

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) When I ran the command gulp vscode-win32-ia32, this was the error output:

[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) When I ran the command gulp vscode-win32-x64, this was the error output:

[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) When I ran the command npm run gulp -- vscode-win32-ia32, this was the error output:

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

File npm-debug.log for the command npm run gulp -- vscode-win32-ia32 just above.

11) When I ran the command gulp watch --max-old-space-size=4096, this was the output, and the program hanged on this line:

sublime_shell

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

npm version

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 Version: code-oss-dev@1.15.0
  • OS Version: Windows 10 build 15063 x64

Originally posted on: Failed at the code-oss-dev@1.15.0 watch script 'gulp watch --max_old_space_size=4096'


Related issues:

  1. Development Environment Improvements (code.bat/code.sh)
  2. Errors Compiling from Source on Arch Linux
  3. Unable to setup vscode locally
  4. Debug Batch (.bat) files
  5. "JavaScript heap out of memory" when building on RHEL-7
  6. Failed at the electron-mksnapshot@1.6.0 install script
  7. Unhandled stream error in pipe
  8. stream.js:74 throw er; // Unhandled stream error in pipe.
  9. Node.js – events js 72 throw er unhandled 'error' event
  10. vscode-win32-ia32 build failure: JavaScript heap out of memory
  11. FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
  12. npm/npm#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
  13. nodejs/node#FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
  • I'm unable to reproduce your problem here. After a clean clone of the repository, I run `scripts\npm.bat install` with no issues, then `scripts\code.bat` and a production version of VS Code pops up (like you've shown) but with all the expected UI elements. Try a fresh start? – James Aug 23 '17 at 19:33
  • I had successfully build it after updating my nodejs version, and following the steps on the VSCode issue tracker about this problem. I am going to post a answer with updated steps/status. – Evandro Coan Aug 23 '17 at 23:26

2 Answers2

1

The problem seems to be the outdated version 6.11.0 of nodejs used. From the issue: Failed at the code-oss-dev@1.15.0 watch script 'gulp watch --max_old_space_size=4096' on the VSCode issue tracker, we may follow the steps:

  1. Install Node 7.9.0
  2. git clean -xfd .
  3. git pull
  4. .\scripts\npm.bat install

Then, if there are no errors:

  1. npm run watch

Run it until it tells you compilation succeeded. Then:

  1. .\scripts\code.bat
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
0

When I try to follow the instructions, I get:

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

Not sure why, but it seems as if node-gyp cannot find visual studio.

Elior Malul
  • 683
  • 6
  • 8