Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run build failure #123

Open
abhishek-goel opened this issue Oct 17, 2024 · 4 comments
Open

npm run build failure #123

abhishek-goel opened this issue Oct 17, 2024 · 4 comments

Comments

@abhishek-goel
Copy link

Hello - I'm a former C1 Associate and trying to use this extension, but I'm unable to build it.

npm run build fails with the error:

./src/polyfills.ts:64:0-27 - Error: Module not found: Error: Package path ./dist/zone is not exported from package acronym-decoder/node_modules/zone.js (see exports field in acronym-decoder/node_modules/zone.js/package.json)

bash-3.2$ node --version
v23.0.0

Command used to install: bash-3.2$ npm install --legacy-peer-deps --verbose

Any clue what may be going wrong here?

@abhishek-goel
Copy link
Author

abhishek-goel commented Oct 21, 2024

Thanks to https://stackoverflow.com/a/77676983, I was able to complete the build. However, now that I have the extension running in my browser it gets stuck on `Looking up definitions for ...' when I do the search for an acronym.

I'm running locally, reading the acronyms from dist/glossary.json and I confirmed that the Acronym I'm looking for is present in my glossary.json file.

Any thoughts on how to address that?

UPDATE: Figured it out. It was a trailing comma. Updated it in src/glossary.json and ran npm run build but that didn't update the glossary.json in dist/ folder. So updated in the dist/ folder directly for now.

@abhishek-goel
Copy link
Author

I'm keeping this issue open till someone from Capital One has confirmed that the stackoverflow link provides the correct solution and then I (or someone else) raises a PR to update src/polyfill.js.

Also, if someone from Capital One can update the dependency tree to eliminate the need for me to use --legacy-peer-deps when running npm install, that would be much appreciated.

@amadib
Copy link
Contributor

amadib commented Dec 10, 2024

What version of node are you running and can you share the full stacktrace?

@abhishek-goel
Copy link
Author

abhishek-goel commented Dec 10, 2024

@amadib

  • Here are the versions
bash-3.2$ npm --version
10.9.0
bash-3.2$ node --version
v22.12.0

Note: I was using v23.0.0 earlier but have since switched to v22.12.0 which is the LTS version


  • Here is what happens if I just run npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @angular/[email protected]
npm error Found: [email protected]
npm error node_modules/zone.js
npm error   zone.js@"^0.14.6" from the root project
npm error
npm error Could not resolve dependency:
npm error peer zone.js@"~0.13.0" from @angular/[email protected]
npm error node_modules/@angular/core
npm error   @angular/core@"^16.2.12" from the root project
npm error   peer @angular/core@"16.2.12" from @angular/[email protected]
npm error   node_modules/@angular/animations
npm error     @angular/animations@"^16.2.12" from the root project
npm error     2 more (@angular/material, @angular/platform-browser)
npm error   10 more (@angular/cdk, @angular/common, @angular/compiler, ...)
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/zone.js
npm error   peer zone.js@"~0.13.0" from @angular/[email protected]
npm error   node_modules/@angular/core
npm error     @angular/core@"^16.2.12" from the root project
npm error     peer @angular/core@"16.2.12" from @angular/[email protected]
npm error     node_modules/@angular/animations
npm error       @angular/animations@"^16.2.12" from the root project
npm error       2 more (@angular/material, @angular/platform-browser)
npm error     10 more (@angular/cdk, @angular/common, @angular/compiler, ...)
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

  • Here's what happens when I run npm install --legacy-peer-deps, the following logs are displayed, but execution is stalled at this point
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.
npm warn deprecated [email protected]: this library is no longer supported
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated @wessberg/[email protected]: this package has been renamed to ts-evaluator. Please install ts-evaluator instead
npm warn deprecated [email protected]: We have news to share - Protractor is deprecated and will reach end-of-life by Summer 2023. To learn more and find out about other options please refer to this post on the Angular blog. Thank you for using and contributing to Protractor. https://goo.gle/state-of-e2e-in-angular
npm warn deprecated @angular/[email protected]: This package has been deprecated. Please see https://blog.angular.io/modern-css-in-angular-layouts-4a259dca9127
npm warn deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

  • Running the same command with --verbose shows me multiple failures fetching packages from Capital One's Artifactory
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@istanbuljs/schema/-/schema-0.1.3.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@xtuc/long/-/long-4.2.2.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/win32-arm64/-/win32-arm64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@types/retry/-/retry-0.12.0.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/sunos-x64/-/sunos-x64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-riscv64/-/linux-riscv64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/netbsd-x64/-/netbsd-x64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@xtuc/ieee754/-/ieee754-1.2.0.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-s390x/-/linux-s390x-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-x64/-/linux-x64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-arm64/-/linux-arm64-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-ia32/-/linux-ia32-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-mips64el/-/linux-mips64el-0.18.17.tgz attempt 2 failed with ENOTFOUND
npm http fetch GET https://artifactory.cloud.capitalone.com/artifactory/api/npm/npm-internalfacing/@esbuild/linux-arm/-/linux-arm-0.18.17.tgz attempt 2 failed with ENOTFOUND

  • Next, I run rm -fr node_modules package-lock.json to essentially perform a clean and then run npm install --legacy-peer-deps and finally encounter success
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: this library is no longer supported
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated @wessberg/[email protected]: this package has been renamed to ts-evaluator. Please install ts-evaluator instead
npm warn deprecated @angular/[email protected]: This package has been deprecated. Please see https://blog.angular.io/modern-css-in-angular-layouts-4a259dca9127
npm warn deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

added 1250 packages, and audited 1251 packages in 48s

129 packages are looking for funding
  run `npm fund` for details

9 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

❗ ❗ ❗
This is just the npm install process. I'm detailing this here just to showcase that it's not just a straight npm install. It is quite involved. I think acronym-decoder is a great solution and Capital One did a fantastic job building and open-sourcing it. But now it needs to be maintained 💔


Now, moving on to the actual running. When I execute npm run build, here's what I get:

bash-3.2$ npm run build

> [email protected] build
> ng build && webpack

Workspace extension with invalid name (defaultProject) found.
⠋ Generating browser application bundles (phase: setup)...    TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration. For more information, see https://angular.io/guide/build#configuring-browser-compatibility
    NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.
    Components styles sourcemaps are not generated when styles optimization is enabled.
✔ Browser application bundle generation complete.

./src/styles.scss - Warning: Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Angular Material themes should be created from a map containing the keys "color", "typography", and "density". The color value should be a map containing the palette values for "primary", "accent", and "warn". See https://material.angular.io/guide/theming for more information.

node_modules/@angular/material/core/theming/_theming.scss 186:5             define-light-theme()
node_modules/@angular/material/core/theming/_theming-deprecated.scss 26:11  light-theme()
src/decoder-default-palette.scss 27:13                                      @import
src/decoder-app-theme.scss 25:9                                             @import
src/styles.scss 18:9                                                        root stylesheet


./src/app/homepage/homepage.component.scss?ngResource - Warning: Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Angular Material themes should be created from a map containing the keys "color", "typography", and "density". The color value should be a map containing the palette values for "primary", "accent", and "warn". See https://material.angular.io/guide/theming for more information.

node_modules/@angular/material/core/theming/_theming.scss 186:5             define-light-theme()
node_modules/@angular/material/core/theming/_theming-deprecated.scss 26:11  light-theme()
src/decoder-default-palette.scss 27:13                                      @import
src/app/homepage/homepage.component.scss 19:9                               root stylesheet




./src/polyfills.ts:64:0-27 - Error: Module not found: Error: Package path ./dist/zone is not exported from package /Users/abhishek.goel/Development/capitalone/acronym-decoder/node_modules/zone.js (see exports field in /Users/abhishek.goel/Development/capitalone/acronym-decoder/node_modules/zone.js/package.json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants