#I forked angular repo from remote to my local system then run yarn install gives the following error
12 messages · Page 1 of 1 (latest)
Does your tsconfig have it's module and moduleResolution set to NodeNext? What version of Node are you using?
yarn version v1.22.19
Node.js v20.11.0
As mentioned in package.json
"engines": {
"node": "^18.13.0 || ^20.9.0",
"yarn": ">=1.22.4 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
and i just follow the instructions from angular team :
Getting the Sources
Fork and clone the Angular repository:
- Login to your GitHub account or create one by following the instructions given
here. - Fork the main Angular
repository. - Clone your fork of the Angular repository and define an
upstreamremote pointing back to
the Angular repository that you forked in the first place.
# Clone your GitHub repository:
git clone [email protected]:<github username>/angular.git
# Go to the Angular directory:
cd angular
# Add the main Angular repository as an upstream remote to your repository:
git remote add upstream https://github.com/angular/angular.git
Installing NPM Modules
Next, install the JavaScript modules needed to build and test Angular:
# Install Angular project dependencies (package.json)
yarn install
Building
To build Angular run:
yarn build
- Results are put in the
dist/packages-distfolder.
Access your support options and sign in to your account for GitHub software support and product assistance. Get the help you need from our dedicated support team.
And are you actually meaning to contribute back to the core Angular repository? I hate to double check, but you aren't just trying to make an Angular frontend?
Did you run the postinstall script prior to running the build script?
No ... first run yarn install then build
$ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts" for /media/karimul/6C4EE18D4EE1507E/open source/angular/scripts/build/build-packages-dist.mts
Ok, could you run yarn postinstall and then try yarn build again
why this happen again TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts" for ???
$ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts
why .mts file extension not supporting which is located in script folder ??
I googled a bit and it seems that node 20 introduced a breaking change that causes this error. Could you try to downgrade to node 18 and try?
see https://github.com/nodejs/node/issues/48257 and https://github.com/TypeStrong/ts-node/issues/1997