angular icon indicating copy to clipboard operation
angular copied to clipboard

Error building project using artifacts created from angular source code build

Open phalgunv opened this issue 2 years ago โ€ข 19 comments

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

In order to inestigate https://github.com/angular/angular/issues/13993, first I build angular-cli from source, then installed the tar balls and created a new angular project with it. This was done so that a new angular project is created with the correct dependencies.

Then I followed instructions at thttps://github.com/angular/angular/blob/main/docs/DEVELOPER.md to copy angular build artifacts over to the newly created project using yarn link. Running "npm start" results in the above error.

I manually updated the javascript bundle where the issue was found and replaced ExternalExpr as suggested in the error message below. When I ran npm start again, I did not get error for ExternalExpr but similar error for another named export. Is there anything I am missing?

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

An unhandled exception occurred: Named export 'ExternalExpr' not found. The requested module '@angular/compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@angular/compiler';
const { ExternalExpr, ExternalReference, WrappedNodeExpr } = pkg;

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.1.0-next.0
node: v14.17.0

Anything else?

No response

phalgunv avatar Jun 14 '22 20:06 phalgunv

Are you sure you installed local versions of all Angular packages? I think for us to investigate this, you'll need to provide a repo that demonstrates the issue.

alxhub avatar Jun 14 '22 21:06 alxhub

Assigned P5 pending reproduction of issue, after which the priority can be updated as required.

bob-watson avatar Jun 28 '22 15:06 bob-watson

I have added steps to reproduce the issue. I have run the below command on a Windows 10 machine using git-bash.

  1. Clone, install and generate local build of angular-cli
git clone https://github.com/angular/angular-cli.git
cd angular-cli
yarn
yarn build --local
  1. Check that version of global @angular/cli is 14.0.4, which is used to create a new angular app.
PS C:\code\github> ng v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.0.4
Node: 14.17.0
Package Manager: npm 6.14.13
OS: win32 x64

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1400.4
@angular-devkit/core         14.0.4
@angular-devkit/schematics   14.0.4
@angular/cli                 14.0.4
@schematics/angular          14.0.4

  1. Create a new angular app using 14.0.4 version of @angular/cli package.
ng new test

#Start the App
cd test

$ npm run start

> [email protected] start C:\code\github\test
> ng serve

โˆš Browser application bundle generation complete.

Initial Chunk Files   | Names         |  Raw Size
vendor.js             | vendor        |   1.72 MB |
polyfills.js          | polyfills     | 315.31 kB |
styles.css, styles.js | styles        | 207.34 kB |
main.js               | main          |  48.29 kB |
runtime.js            | runtime       |   6.51 kB |

                      | Initial Total |   2.28 MB

Build at: 2022-07-06T19:07:22.486Z - Hash: 5abe47e6002c28a9 - Time: 11853ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://local
host:4200/ **


โˆš Compiled successfully.

  1. Link local build of angular-cli
export EXAMPLE_ANGULAR_PROJECT_REPO=/c/code/github/test
export CLI_REPO=/c/code/github/angular-cli/
cd "${EXAMPLE_ANGULAR_PROJECT_REPO}"
npm install -D ${CLI_REPO}/dist/*.tgz
  1. Check the version of @angular/cli is 14.1.0-next.3. This proves that the installation of local build of @angular/cli package was successful.
$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.1.0-next.3
Node: 14.17.0
Package Manager: npm 6.14.13
OS: win32 x64

Angular: 14.0.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                          Version
----------------------------------------------------------
@angular-devkit/architect        0.1401.0-next.3
@angular-devkit/architect-cli    0.1401.0-next.3
@angular-devkit/build-angular    14.1.0-next.3
@angular-devkit/build-webpack    0.1401.0-next.3
@angular-devkit/core             14.1.0-next.3
@angular-devkit/schematics       14.1.0-next.3
@angular-devkit/schematics-cli   14.1.0-next.3
@angular/cli                     14.1.0-next.3
@angular/pwa                     14.1.0-next.3
@ngtools/webpack                 14.1.0-next.3
@schematics/angular              14.1.0-next.3
rxjs                             7.5.5
typescript                       4.7.4

  1. Check that dev server can be started
$ npm start

> [email protected] start C:\code\github\test
> ng serve

โˆš Browser application bundle generation complete.

Initial Chunk Files   | Names         |  Raw Size
vendor.js             | vendor        |   1.72 MB |
polyfills.js          | polyfills     | 315.33 kB |
styles.css, styles.js | styles        | 207.36 kB |
main.js               | main          |  48.29 kB |
runtime.js            | runtime       |   6.51 kB |

                      | Initial Total |   2.28 MB

Build at: 2022-07-06T19:10:19.169Z - Hash: b5506d39ac42da52 - Time: 11529ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://local
host:4200/ **


โˆš Compiled successfully.
  1. Clone angular repo - https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#getting-the-sources
  2. Install dependencies - https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#installing-npm-modules
  3. Build - https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#building
  4. Link locally built artifacts from angular repo to the angular project created earlier.
cd /c/code/angular;

$ yarn ng-dev misc build-and-link ${EXAMPLE_ANGULAR_PROJECT_REPO}
yarn run v1.22.17
$ C:\code\angular\node_modules\.bin\ng-dev misc build-and-link C:/code/github/test
Starting local Bazel server and connecting to it...
C:/users/pvaddepa/_bazel_pvaddepa/mfejoick/execroot/angular/bazel-out/x64_windows-fastbuild/bin
##################################
node_modules\@angular\dev-infra-private\ng-dev\bundles\release\build\build-worker.js:
  Building @angular/* npm packages
  Mode: false
##################################
Loading: 276 packages loaded
//packages/animations:npm_package
//packages/bazel:npm_package
//packages/common:npm_package
//packages/compiler:npm_package
//packages/compiler-cli:npm_package
//packages/core:npm_package
//packages/elements:npm_package
//packages/forms:npm_package
//packages/language-service:npm_package
//packages/localize:npm_package
//packages/platform-browser:npm_package
//packages/platform-browser-dynamic:npm_package
//packages/platform-server:npm_package
//packages/router:npm_package
//packages/service-worker:npm_package
//packages/upgrade:npm_package
Building in release mode. Resetting the Bazel execroot and action cache..
INFO: Starting clean.
INFO: Analyzed 16 targets (469 packages loaded, 47666 targets configured).
INFO: Found 16 targets...
INFO: From Bundling JavaScript packages/language-service/bundles/language-service.js [rollup]:
(!) Missing shims for Node.js built-ins
Creating a browser bundle that depends on "os", "path" and "url". You might need to include https://
github.com/snowpackjs/rollup-plugin-polyfill-node
INFO: From Executing genrule //packages/common/locales:locale_files:
Writing locales to: bazel-out/x64_windows-fastbuild/bin/packages/common/locales
INFO: Elapsed time: 866.100s, Critical Path: 390.94s
INFO: 878 processes: 482 internal, 110 local, 286 worker.
INFO: Build completed successfully, 878 total actions
# Copy artifacts to C:\code\angular\dist\release-output/animations
# Copy artifacts to C:\code\angular\dist\release-output/bazel
# Copy artifacts to C:\code\angular\dist\release-output/common
# Copy artifacts to C:\code\angular\dist\release-output/compiler
# Copy artifacts to C:\code\angular\dist\release-output/compiler-cli
# Copy artifacts to C:\code\angular\dist\release-output/core
# Copy artifacts to C:\code\angular\dist\release-output/elements
# Copy artifacts to C:\code\angular\dist\release-output/forms
# Copy artifacts to C:\code\angular\dist\release-output/language-service
# Copy artifacts to C:\code\angular\dist\release-output/localize
# Copy artifacts to C:\code\angular\dist\release-output/platform-browser
# Copy artifacts to C:\code\angular\dist\release-output/platform-browser-dynamic
# Copy artifacts to C:\code\angular\dist\release-output/platform-server
# Copy artifacts to C:\code\angular\dist\release-output/router
# Copy artifacts to C:\code\angular\dist\release-output/service-worker
# Copy artifacts to C:\code\angular\dist\release-output/upgrade

 โœ“  Built release output.
warning There's already a package called "@angular/animations" registered. This command has had no e
ffect. If this command was run in another folder with the same name, the other folder is still linke
d. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/animations".
warning There's already a package called "@angular/bazel" registered. This command has had no effect
. If this command was run in another folder with the same name, the other folder is still linked. Pl
ease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/bazel".
warning There's already a package called "@angular/common" registered. This command has had no effec
t. If this command was run in another folder with the same name, the other folder is still linked. P
lease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/common".
warning There's already a package called "@angular/compiler" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
 Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/compiler".
warning There's already a package called "@angular/compiler-cli" registered. This command has had no
 effect. If this command was run in another folder with the same name, the other folder is still lin
ked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/compiler-cli".
warning There's already a package called "@angular/core" registered. This command has had no effect.
 If this command was run in another folder with the same name, the other folder is still linked. Ple
ase run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/core".
warning There's already a package called "@angular/elements" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
 Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/elements".
warning There's already a package called "@angular/forms" registered. This command has had no effect
. If this command was run in another folder with the same name, the other folder is still linked. Pl
ease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/forms".
warning There's already a package called "@angular/language-service" registered. This command has ha
d no effect. If this command was run in another folder with the same name, the other folder is still
 linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/language-service".
warning There's already a package called "@angular/localize" registered. This command has had no eff
ect. If this command was run in another folder with the same name, the other folder is still linked.
 Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/localize".
warning There's already a package called "@angular/platform-browser" registered. This command has ha
d no effect. If this command was run in another folder with the same name, the other folder is still
 linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-browser".
warning There's already a package called "@angular/platform-browser-dynamic" registered. This comman
d has had no effect. If this command was run in another folder with the same name, the other folder
is still linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-browser-dynamic".
warning There's already a package called "@angular/platform-server" registered. This command has had
 no effect. If this command was run in another folder with the same name, the other folder is still
linked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/platform-server".
warning There's already a package called "@angular/router" registered. This command has had no effec
t. If this command was run in another folder with the same name, the other folder is still linked. P
lease run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/router".
warning There's already a package called "@angular/service-worker" registered. This command has had
no effect. If this command was run in another folder with the same name, the other folder is still l
inked. Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/service-worker".
warning There's already a package called "@angular/upgrade" registered. This command has had no effe
ct. If this command was run in another folder with the same name, the other folder is still linked.
Please run yarn unlink in the other folder if you want to register this folder.
warning ..\package.json: No license field
success Using linked package for "@angular/upgrade".
 โœ“  Linked release packages in provided project.
Done in 945.36s.

  1. Attempt to start dev server fails
$ npm start

> [email protected] start C:\code\github\test
> ng serve

An unhandled exception occurred: Named export 'ExternalExpr' not found. The requested module '@angul
ar/compiler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@angular/compiler';
const { ExternalExpr, ExternalReference, WrappedNodeExpr } = pkg;

See "C:\Users\pvaddepa\AppData\Local\Temp\ng-OCRhVe\angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! errno ENOENT
npm ERR! [email protected] start: `ng serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pvaddepa\AppData\Roaming\npm-cache\_logs\2022-07-06T19_29_13_736Z-debug.log

Log File: 2022-07-06T19_29_13_736Z-debug.log

It is clear that dev server fails to start after linking the local artifacts from angular build.

phalgunv avatar Jul 06 '22 19:07 phalgunv

This warnings look suspicious:

warning There's already a package called "@angular/animations" registered. This command has had no e
ffect. If this command was run in another folder with the same name, the other folder is still linke
d. Please run yarn unlink in the other folder if you want to register this folder.

That might mean that you're actually linking a completely different build of the Angular framework packages than the ones you just built from source.

JoostK avatar Jul 06 '22 20:07 JoostK

I ran the yarn link command from the same directory containing angular source code.

cd /c/code/angular

$ yarn ng-dev misc build-and-link ${EXAMPLE_ANGULAR_PROJECT_REPO}

phalgunv avatar Jul 07 '22 04:07 phalgunv

And the warnings indicate that there are pre-existing links. I can't tell from that warning where those links were created, but it may be that you'll first have to unlink from a different directory. It might also be that Yarn reports that warning if the link is already created from within the same directory, in which case the warning is a red-herring.

JoostK avatar Jul 08 '22 07:07 JoostK

This is caused by symbolic links being resolved using their real path which eventually would cause node module resolution to fail.

You need to spawn the CLI using node --preserve-symlinks

node --preserve-symlinks node_modules/.bin/ng s

This would still cause the same error but this time in NGCC. We are spawning NGCC using a child process, which also requires the node option --preserve-symlinks-main to be passed. This gets a bit tricky because we cannot pass it from the command line since this would break the Angular CLI. Therefore, since Angular packages don't need to be NGCC'd you can bypass this by setting BAZEL_TARGET to a truthy value.

Unix Systems

BAZEL_TARGET="1" node --preserve-symlinks node_modules/.bin/ng s

Windows

set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/.bin/ng s

alan-agius4 avatar Jul 08 '22 07:07 alan-agius4

I am assuming that I only need to start the dev server using the command provided, i.e. re-run step 12.

I see a different error now from node.js. The result is same when I run from cmd and git-bash.

`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/.bin/ng s C:\code\github\test\node_modules.bin\ng:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^

SyntaxError: missing ) after argument list โ†[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)โ†[39m โ†[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)โ†[39m โ†[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)โ†[39m โ†[90m at Module.load (internal/modules/cjs/loader.js:933:32)โ†[39m โ†[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)โ†[39m โ†[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)โ†[39m โ†[90m at internal/main/run_main_module.js:17:47โ†[39m`

phalgunv avatar Jul 08 '22 22:07 phalgunv

Can you try the below please?

set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s

Or

set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s

alan-agius4 avatar Jul 08 '22 23:07 alan-agius4

I get the same error with set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s:

`C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks "node_modules/.bin/ng" s C:\code\github\test\node_modules.bin\ng:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^

SyntaxError: missing ) after argument list โ†[90m at wrapSafe (internal/modules/cjs/loader.js:984:16)โ†[39m โ†[90m at Module._compile (internal/modules/cjs/loader.js:1032:27)โ†[39m โ†[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)โ†[39m โ†[90m at Module.load (internal/modules/cjs/loader.js:933:32)โ†[39m โ†[90m at Function.Module._load (internal/modules/cjs/loader.js:774:14)โ†[39m โ†[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)โ†[39m โ†[90m at internal/main/run_main_module.js:17:47โ†[39m`

Finally, set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s worked like a charm! Thanks @alan-agius4 `C:\code\github\test>set BAZEL_TARGET="1" && node --preserve-symlinks node_modules/@angular/cli/lib/init.js s โˆš Browser application bundle generation complete.

Initial Chunk Files | Names | Raw Size vendor.js | vendor | 1.74 MB | polyfills.js | polyfills | 315.33 kB | styles.css, styles.js | styles | 207.36 kB | main.js | main | 48.30 kB | runtime.js | runtime | 6.51 kB |

                  | Initial Total |   2.30 MB

Build at: 2022-07-08T23:35:27.526Z - Hash: 22eabbc2eb8b501b - Time: 8113ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

โˆš Compiled successfully.`

Does it mean the https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#building needs to be updated?

phalgunv avatar Jul 08 '22 23:07 phalgunv

Does it mean the https://github.com/angular/angular/blob/main/docs/DEVELOPER.md#building needs to be updated?

Yes.

alan-agius4 avatar Jul 11 '22 06:07 alan-agius4

I have pulled the latest commits from angular repo into my forked repo. The command to build the source code has been updated after I posted raised this issue. The new command is yarn build, introduced as part of Commit fails with the error:

PS C:\code\angular> yarn build yarn run v1.22.17 error Command "build" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I see in package.json, scripts->build target is missing. Do I need to raise separate issue for this?

phalgunv avatar Jul 11 '22 17:07 phalgunv

The build script does exist:

https://github.com/angular/angular/blob/e58207e444af7347699ff9f01492f886cd09da06/package.json#L28

JoostK avatar Jul 11 '22 18:07 JoostK

My bad.

phalgunv avatar Jul 11 '22 18:07 phalgunv

When I ran "git pull", it incorrectly showed that my local repository was up to date whereas it was stuck at the commit https://github.com/angular/angular/tree/f94c6f433dba3924b79f137cfcc49d2dfd4d679c from 17-June. Since the "build" was added later "yarn build" was failing as it could not find build.

I have cloned the repo again, ran yarn install and then yarn build fails with the below error when run via Window PowerShell 7.2.5 : yarn run v1.22.17 $ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts ###################################### Building release packages... ###################################### Starting local Bazel server and connecting to it... Loading: 284 packages loaded //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package C:/users/pvaddepa/_bazel_pvaddepa/hwug4sdk/execroot/angular/bazel-out/x64_windows-fastbuild/bin INFO: Analyzed 16 targets (364 packages loaded, 44542 targets configured). INFO: Found 16 targets... ERROR: <builtin>: BazelWorkspaceStatusAction stable-status.txt failed: Failed to determine workspace status: Process exited with status 1 C:\code\angular_new\node_modules\ts-node\src\index.ts:843 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ฮ“ยฟยป Unable to compile TypeScript: error TS5083: Cannot read file 'C:\.ng-dev\tsconfig.json'.

at createTSError (C:\code\angular_new\node_modules\ts-node\src\index.ts:843:12)
at reportTSError (C:\code\angular_new\node_modules\ts-node\src\index.ts:847:19)
at createFromPreloadedConfig (C:\code\angular_new\node_modules\ts-node\src\index.ts:858:36)
at create (C:\code\angular_new\node_modules\ts-node\src\index.ts:613:10)
at register (C:\code\angular_new\node_modules\ts-node\src\index.ts:580:15)
at Object.registerAndCreateEsmHooks (C:\code\angular_new\node_modules\ts-node\src\esm.ts:116:34)
at file:///C:/code/angular_new/node_modules/ts-node/esm.mjs:8:7
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at async Loader.import (internal/modules/esm/loader.js:178:24)
at async internal/process/esm_loader.js:57:9 {
diagnosticCodes: [ 5083 ]
}

ERROR: C:/code/angular_new/packages/common/BUILD.bazel:36:11 Assembling npm package packages/common/npm_package failed: Failed to determine workspace status: Process exited with status 1 INFO: Elapsed time: 22.438s, Critical Path: 4.82s INFO: 9 processes: 9 internal. FAILED: Build did NOT complete successfully Error: Command failed: yarn -s bazel build --config=snapshot-build //packages/animations:npm_package //packages/bazel:npm_package //packages/common:npm_package //packages/compiler:npm_package //packages/compiler-cli:npm_package //packages/core:npm_package //packages/elements:npm_package //packages/forms:npm_package //packages/language-service:npm_package //packages/localize:npm_package //packages/platform-browser:npm_package //packages/platform-browser-dynamic:npm_package //packages/platform-server:npm_package //packages/router:npm_package //packages/service-worker:npm_package //packages/upgrade:npm_package at checkExecSyncError (child_process.js:790:11) at execSync (child_process.js:863:15) at exec (file:///C:/code/angular_new/scripts/build/package-builder.mts:126:18) at buildReleasePackages (file:///C:/code/angular_new/scripts/build/package-builder.mts:80:3) at performDefaultSnapshotBuild (file:///C:/code/angular_new/scripts/build/package-builder.mts:45:10) at file:///C:/code/angular_new/scripts/build/build-packages-dist.mts:17:1 at ModuleJob.run (internal/modules/esm/module_job.js:183:25) at async Loader.import (internal/modules/esm/loader.js:178:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) { status: 1, signal: null, output: [ null, null, null ], pid: 22872, stdout: null, stderr: null } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When I run in Ubuntu using WSL, yarn build works fine.

phalgunv avatar Jul 31 '22 19:07 phalgunv

@alan-agius4 is this the new way of using ng serve if you want to use a local Angular build? node --preserve-symlinks node_modules/.bin/ng s. It worked for me. If so, I'm available to open a PR with that command to update the documentation. I'm just starting to try to contribute so this is a good first contribution for me.

fabioemoutinho avatar Sep 13 '22 15:09 fabioemoutinho

@fabioemoutinho correct note that s above is an alias for serve and can be replaced with any Angular CLI command.

alan-agius4 avatar Sep 13 '22 16:09 alan-agius4

@alan-agius4 I noticed I had to disable cli cache in angular.json in order to be able to make changes, thus only requiring a ng serve restart. Do you think this is a good addition to the documentation? Any other tips about serving you might share?

fabioemoutinho avatar Sep 13 '22 17:09 fabioemoutinho

Yeah, you can mention that you need to run ng cache disable.

alan-agius4 avatar Sep 13 '22 17:09 alan-agius4

It looks like the docs part of this has been resolved. If so, can we remove the comp: docs label?

bob-watson avatar Sep 27 '22 14:09 bob-watson

This can actually be closed now since this was only a docs related change.

alan-agius4 avatar Sep 27 '22 14:09 alan-agius4

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

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.