Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

npm error when publishing after ANZ v10.1 Angular/.Net5 upgrade #9986


User avatar
0
henryand created

This is my first attempt at publishing after doing a major upgrade of the ANZ platform. the code works fine (npm run start) but crashes when publishing (npm publish/npm run publish)

note: one difference is that in angular.json, in the "abp-zero-template" the "options" section has "aot": false, but in "production" section "aot":true. I was able to publish with "aot":false, and then having to also set "buildOptimizer":false, but that crashed our production server.

npm publish ... npm ERR! code E404 npm ERR! 404 Not Found - PUT https://registry.npmjs.org/abp-zero-template - Not found npm ERR! 404 npm ERR! 404 '[email protected]' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

============================================================================= npm run publish ... Error: Error: Could not resolve [object Object] / undefined at Scope.resolve (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1318:23) at Scope.resolve (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36) at TcbExpressionTranslator.resolveTarget (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1877:35) at TcbExpressionTranslator.resolve (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1786:29) at AstTranslator.maybeResolve (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:84) at AstTranslator.translate (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:74:33) at Object.astToTypescript (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:55:27) at TcbExpressionTranslator.translate (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:33) at tcbExpression (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1759:27) at TcbUnclaimedInputsOp.execute (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:848:32) at Scope.executeOp (D:\stepwell-anz\src\Stepwell.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1428:26)[0m at Scope.render (D:{our project}\src{our project}.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1335:22) at TcbTemplateBodyOp.execute (D:{our project}\src{our project}.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:318:40) at Scope.executeOp (D:{our project}\src{our project}.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1428:26) at Scope.render (D:{our project}\src{our project}.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1335:22) at Object.generateTypeCheckBlock (D:{our project}\src{our project}.Web.Host\node_modules@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:58:37)

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] publish: gulp build && ng build --prod npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] publish script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @henryand

    Could you share your package.json and angular.json files with us ?

    Thanks,

  • User Avatar
    0
    henryand created

    We were able to track down the root cause this morning by turning off strict templates and fulltemplattypecheck in tsconfig. This allowed us to see some old code that was not strictly typed which did not meet the upgrade standards. we then deleted the offending code since we no longer used it anyway. we turned the compiler options back to true and we are published!

    "angularCompilerOptions": { "fullTemplateTypeCheck": false, "strictTemplates": false,

    hope this helps others if they get the same error.

    thanks!