Starts in:
0 DAY
17 HRS
3 MIN
22 SEC
Starts in:
0 D
17 H
3 M
22 S
Open Closed

Error on adding custom abp Angular module npm to a new abp solution #410


User avatar
0
buaziz created
  • ABP Framework version: v3.1.0

  • UI type: Angular

  • Exception message and stack trace:

the important parts of the error

  • Command: npm run compile:ivy
  • error Command "ngcc" not found.
error C:\Source\MyProject.Demo\angular\node_modules\@MyModules\myModule: Command failed.
Exit code: 1
Command: npm run compile:ivy
Arguments:
Directory: C:\Source\MyProject.Demo\angular\node_modules\@MyModules\myModule
Output:
> @MyModules/myModule@0.0.10 compile:ivy C:\Source\MyProject.Demo\angular\node_modules\@MyModules\myModule
> yarn ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points --tsconfig './tsconfig.prod.json' --source node_modules --async false

yarn run v1.22.4
error Command "ngcc" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @MyModules/myModule@0.0.10 compile:ivy: `yarn ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points --tsconfig './tsconfig.prod.json' --source node_modules --async false`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @MyModules/myModule@0.0.10 compile:ivy 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\s\AppData\Roaming\npm-cache\_logs\2020-09-09T08_03_25_666Z-debug.log
  • Steps to reproduce the issue:
  • Create a new module with -t module-pro -u angular
  • build and publish to Azure Artifacts npm feed
  • create new abp angular app
  • add custom abp angular module npm package to new abp app

5 Answer(s)
  • User Avatar
    0
    buaziz created

    I think I need more details on how package/publish a custom abp angular module like abp.ng.language-management

  • User Avatar
    0
    buaziz created

    Dears,

    any response.

  • User Avatar
    0
    Mehmet created

    Hi @buaziz

    Please remove yarn.lock and package-lock.json files and run the yarn install command again. The ngcc error will probably be resolved. If you still encounter this error, add the below script to the scripts of package.json.

    "compile:ivy": "...",
    "ngcc": "ngcc" // add this
    

    How to publish a package to the NPM

    Build your package with the below command:

    yarn ng build <place here your package name in angular.json> --prod
    

    After the building, you will see the output folder in the dist folder.

    Open dist/your-package-name folder via terminal.

    Run the npm login command and enter the username and password.

    Then run the npm publish command.

  • User Avatar
    0
    Mehmet created

    v3.1.1 has been released. We fixed some problems in the module template with this version. I suggest you download the v3.1.1 module template and look at the changes.

  • User Avatar
    0
    buaziz created

    SOLVED. thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06