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.

Error: spawnSync C:\Users\me\repo\oas-web\node_modules\ts-node\dist\bin.js UNKNOWN

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

After upgradring from 11.1.2 -> 11.2.0 I’m no longer able to build our project. Compilation fails with the error message below:

------------------------------------------------------------------------------
Building entry point '@oas/web-lib-angular' 
------------------------------------------------------------------------------
✖ Compiling TypeScript sources through NGC 
ERROR: spawnSync C:\Users\me\repo\oas-web\node_modules\ts-node\dist\bin.js UNKNOWN
<ref *1> Error: spawnSync C:\Users\me\repo\oas-web\node_modules\ts-node\dist\bin.js UNKNOWN 
    at Object.spawnSync (internal/child_process.js:1067:20)
    at spawnSync (child_process.js:602:24)
    at Object.execFileSync (child_process.js:629:15)
    at StylesheetProcessor.process (C:\Users\me\repo\oas-web\packages\web-lib-angular\node_modules\src\lib\styles\stylesheet-processor.ts:40:20)
    at Object.readResource (C:\Users\me\repo\oas-web\packages\web-lib-angular\node_modules\src\lib\ts\cache-compiler-host.ts:136:47)
    at AdapterResourceLoader.preload (C:\Users\me\packages\compiler-cli\src\ngtsc\resource\src\loader.ts:80:33)
    at resolveStyleUrl (C:\Users\me\packages\compiler-cli\src\ngtsc\annotations\src\component.ts:163:43)
    at Array.map (<anonymous>)
    at ComponentDecoratorHandler.preanalyze (C:\Users\me\packages\compiler-cli\src\ngtsc\annotations\src\component.ts:186:75)
    at _loop_1 (C:\Users\me\packages\compiler-cli\src\ngtsc\transform\src\compilation.ts:312:39) {
  errno: -4094,
  code: 'UNKNOWN',
  syscall: 'spawnSync C:\\Users\\me\\repo\\oas-web\\node_modules\\ts-node\\dist\\bin.js',
  path: 'C:\\Users\\me\\repo\\oas-web\\node_modules\\ts-node\\dist\\bin.js',
  spawnargs: [
    'C:\\Users\\me\\repo\\oas-web\\packages\\web-lib-angular\\node_modules\\ng-packagr\\lib\\styles\\stylesheet-processor-worker.js',
    '{"filePath":"C:\\\\Users\\\\me\\\\repo\\\\oas-web\\\\packages\\\\web-lib-angular\\\\src\\\\components\\\\action-menu\\\\action-menu.component.scss","basePath":"C:\\\\Users\\\\me\\\\repo\\\\oas-web\\\\packages\\\\web-lib-angular","cssUrl":"inline","styleIncludePaths":[],"browserslistData":["and_chr 88","and_ff 83","and_qq 10.4","and_uc 12.12","android 81","baidu 7.12","chrome 88","chrome 87","chrome 86","edge 88","edge 87","firefox 85","firefox 84","firefox 78","ie 11","ios_saf 14.0-14.4","ios_saf 13.4-13.7","ios_saf 12.2-12.4","kaios 2.5","op_mini all","op_mob 59","opera 72","opera 71","safari 14","safari 13.1","samsung 13.0","samsung 12.0"]}'
  ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 0,
  stdout: null,
  stderr: null
}

How To Reproduce

Not sure since I’m not sure what’s wrong. I tried to debug with DevTools for Node.JS, but the build actually succeeded when I stepped through all the caught/uncaught exceptions. So there might be a race condition somewhere. I can’t publish our full repo since the code is not open source. But we have a pretty simple lib with some components and directives. I’m using ts-node to inittiate ng-packagr: cross-env NODE_ENV=development ts-node ng-packagr

//ng-packagr.ts
ngPackage
        .ngPackagr()
        .forProject('ng-package.json')
        .withTsConfig('tsconfig.build.json')
        .build()
        .catch(error => {
            console.error(error);
            process.exit(1);
        });

Expected Behaviour

The building process should finish without error.

Version Information

ng-packagr:            11.2.0 
@angular/compiler:     11.1.2 
rollup:                2.38.5
tsickle:
typescript:            4.1.4

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JonWallstencommented, Feb 12, 2021

@alan-agius4 Just wanted to confirm that it works! Thanks!

0reactions
github-actions[bot]commented, Mar 15, 2021

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle Node.js spawnSync errors - Stack Overflow
I'm trying to run "npm publish" from a gulp task. It works, but I want to handle any error that npm command itself...
Read more >
Child process | Node.js v19.3.0 Documentation
spawnSync () function provides equivalent functionality in a synchronous manner that blocks the ... it is called with the arguments (error, stdout, stderr)...
Read more >
Executing shell commands from Node.js - 2ality
We'll first explore spawn() and then spawnSync() . We'll conclude by looking ... Then Node.js uses that executable to execute the command.
Read more >
cross-spawn - npm
A cross platform solution to node's spawn and spawnSync. Installation. Node.js version 8 and up: $ npm install cross-spawn. Node.js version 7 ...
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