question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build on Windows 10

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/....

scripts/build, bazel

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

A clear and concise description of the problem...

While issuing node ./scripts/build/build-packages-dist.js, the build getting failed.

πŸ”¬ Minimal Reproduction

https://stackblitz.com/...

πŸ”₯ Exception or Error


PS D:\OpenSource\angular> node ./scripts/build/build-packages-dist.js >>  buil_error.txt
INFO: Repository npm instantiated at:
  D:/opensource/angular/WORKSPACE:30:13: in <toplevel>
  C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/index.bzl:78:18: in yarn_install
Repository rule yarn_install defined at:
  C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:652:31: in <toplevel>
DEBUG: C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:342:14: _
DEBUG: C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:343:14: <unknown object com.google.devtools.build.lib.bazel.repository.starlark.StarlarkExecutionResult>
ERROR: An error occurred during the fetch of repository 'npm':
   Traceback (most recent call last):
        File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 618, column 15, in _yarn_install_impl
                _copy_file(repository_ctx, repository_ctx.attr.package_json)
        File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 345, column 17, in _copy_file
                fail("mkdir -p %s failed: \nSTDOUT:\n%s\nSTDERR:\n%s" % (dirname, result.stdout, result.stderr))
Error in fail: mkdir -p _ failed:
STDOUT:

STDERR:
java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("mkdir" -p _): The system cannot find the file specified.     
 (error: 2)
ERROR: Error fetching repository: Traceback (most recent call last):
        File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 618, column 15, in _yarn_install_impl
                _copy_file(repository_ctx, repository_ctx.attr.package_json)
        File "C:/users/anusername/_bazel_anusername/idexbm2i/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 345, column 17, in _copy_file
                fail("mkdir -p %s failed: \nSTDOUT:\n%s\nSTDERR:\n%s" % (dirname, result.stdout, result.stderr))
Error in fail: mkdir -p _ failed:
STDOUT:

STDERR:
java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("mkdir" -p _): The system cannot find the file specified.     
 (error: 2)
ERROR: no such package '@npm//@bazel/protractor': mkdir -p _ failed: 
STDOUT:

STDERR:
java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("mkdir" -p _): The system cannot find the file specified.     
 (error: 2)
child_process.js:655
    throw err;
    ^

Error: Command failed: yarn --cwd "D:\OpenSource\angular" --silent bazel info bazel-bin
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at exec (D:\OpenSource\angular\scripts\build\package-builder.js:132:18)
    at Object.<anonymous> (D:\OpenSource\angular\scripts\build\package-builder.js:40:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18) {
  status: 1,
  signal: null,
  output: [ null, Buffer(0) [Uint8Array] [], null ],
  pid: 15276,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: null
}

🌍 Your Environment

Angular Version:





Anything else relevant?

Windows 10 Pro. Build: 19042.867

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
petebacondarwincommented, May 4, 2021

OK, so I pulled the latest master, did a full git clean -xfd, ensure I was on the correct yarn and node versions. Then ran yarn and finally node scripts\build\build-packages-dist.js, and the script completed successfully.

Although I had the C:\msys64\usr\bin in my user PATH, it wasn’t appearing when I ran PATH from the command line, so I added it to the system PATH. So my PATH now contains:

C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\System32\OpenSSH\;
C:\Users\Admin\AppData\Roaming\nvm;
C:\Program Files\nodejs;
C:\Program Files\Git\cmd;
C:\msys64\usr\bin;
C:\Users\Admin\.windows-build-tools\python27\;
C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\bin;
C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;
1reaction
petebacondarwincommented, Apr 27, 2021

Can you try adding C:\msys64\usr\bin to your PATH? I was getting the same problem as this. It turned out that despite having setup BAZEL_SH to correctly point to the msys2 bash program, the PATH was not allowing the scripts being run in that shell to access the relevant tools, such as mkdir.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load windows 10 on a Brand new build
Hi, The error code means the file or directory is corrupted and unreadable. It might be source or the destination. Please try using...
Read more >
How to fix 0x8020000f error - build install fails on Windows 10
Oh no! Windows 10 build install fails with error 0x8020000f?Don't worry too much, just watch this video to see how you can fix...
Read more >
Unable to build Windows App SDK self contained applications ...
When trying to build a self contained unpackaged app the build fails with the following error when the user folder contains a space:...
Read more >
Unable to Build wxWidgets on Windows 10
OS: Windows 10. IDE: Visual Studio 2022. Steps I'm using: 1. unzipping wxWidgets-3.2.1 into an exclusive folder for use with VS2022
Read more >
Can't Install Windows 10 with Code 0x80300024 - EaseUS
[7 Ways] Can't Install Windows 10 on a New Build with Code 0x80300024, Get Help Here! Β· 1. Check the System Requirements Β·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found