在 Angular 生产构建期间出现错误
Getting Error during Angular Production Build
当我准备发布项目时,出现此错误。谁能告诉我如何解决这个问题?
ERROR in ./node_modules/angular2-jwt/angular2-jwt.js
Module build failed: Error: Debug Failure. False expression.
at getJSDocTags (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-optim
er\node_modules\typescript\lib\typescript.js:13197:22)
at getFirstJSDocTag (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-o
imizer\node_modules\typescript\lib\typescript.js:13205:24)
at Object.getJSDocTypeTag (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\b
ld-optimizer\node_modules\typescript\lib\typescript.js:13154:19)
at checkParenthesizedExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-de
it\build-optimizer\node_modules\typescript\lib\typescript.js:45628:56)
at checkExpressionWorker (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45676:28)
at checkExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-op
mizer\node_modules\typescript\lib\typescript.js:45609:42)
at checkBinaryLikeExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devki
build-optimizer\node_modules\typescript\lib\typescript.js:45155:29)
at checkBinaryExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45147:20)
at checkExpressionWorker (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45702:28)
at checkExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-op
mizer\node_modules\typescript\lib\typescript.js:45609:42)
at checkExpressionCached (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45457:38)
at getTypeOfExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\buil
optimizer\node_modules\typescript\lib\typescript.js:45577:28)
at checkDeclarationInitializer (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-dev
t\build-optimizer\node_modules\typescript\lib\typescript.js:45469:24)
at getTypeForVariableLikeDeclaration (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angul
-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:30738:28)
at getWidenedTypeForVariableLikeDeclaration (D:\Visual Studio\asp.net\mean_blog\client\node_modules
angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:30961:24)
at getTypeOfVariableOrParameterOrProperty (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@
gular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:31062:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog@0.0.0 build: `cd client && ng build --prod && cd .. && node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@0.0.0 build 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\Yashdeep Raj\AppData\Roaming\npm-cache\_logs18-07-06T19_43_30_221Z-debug.log
我已经修复了一些错误,但这些是关于模块的,我对这些错误一无所知。
我解决了这个问题,实际上我使用的是angular2-jwt(已弃用)和@auth0/angular-jwt。这引起了问题。所以我用@auth0/angular-jwt卸载了angular2-jwt更新代码,一切都开始正常工作了。
我使用 @auth0/angular-jwt
和 angular 解决了这个问题 6. 您首先需要完全卸载 angular2-jwt:
npm uninstall angular2-jwt --save
那么你可以运行:
npm install @auth0/angular-jwt
只有这两个命令行帮助了我。祝一切顺利。
当我准备发布项目时,出现此错误。谁能告诉我如何解决这个问题?
ERROR in ./node_modules/angular2-jwt/angular2-jwt.js
Module build failed: Error: Debug Failure. False expression.
at getJSDocTags (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-optim
er\node_modules\typescript\lib\typescript.js:13197:22)
at getFirstJSDocTag (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-o
imizer\node_modules\typescript\lib\typescript.js:13205:24)
at Object.getJSDocTypeTag (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\b
ld-optimizer\node_modules\typescript\lib\typescript.js:13154:19)
at checkParenthesizedExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-de
it\build-optimizer\node_modules\typescript\lib\typescript.js:45628:56)
at checkExpressionWorker (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45676:28)
at checkExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-op
mizer\node_modules\typescript\lib\typescript.js:45609:42)
at checkBinaryLikeExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devki
build-optimizer\node_modules\typescript\lib\typescript.js:45155:29)
at checkBinaryExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45147:20)
at checkExpressionWorker (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45702:28)
at checkExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\build-op
mizer\node_modules\typescript\lib\typescript.js:45609:42)
at checkExpressionCached (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\bu
d-optimizer\node_modules\typescript\lib\typescript.js:45457:38)
at getTypeOfExpression (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-devkit\buil
optimizer\node_modules\typescript\lib\typescript.js:45577:28)
at checkDeclarationInitializer (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angular-dev
t\build-optimizer\node_modules\typescript\lib\typescript.js:45469:24)
at getTypeForVariableLikeDeclaration (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@angul
-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:30738:28)
at getWidenedTypeForVariableLikeDeclaration (D:\Visual Studio\asp.net\mean_blog\client\node_modules
angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:30961:24)
at getTypeOfVariableOrParameterOrProperty (D:\Visual Studio\asp.net\mean_blog\client\node_modules\@
gular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:31062:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog@0.0.0 build: `cd client && ng build --prod && cd .. && node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@0.0.0 build 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\Yashdeep Raj\AppData\Roaming\npm-cache\_logs18-07-06T19_43_30_221Z-debug.log
我已经修复了一些错误,但这些是关于模块的,我对这些错误一无所知。
我解决了这个问题,实际上我使用的是angular2-jwt(已弃用)和@auth0/angular-jwt。这引起了问题。所以我用@auth0/angular-jwt卸载了angular2-jwt更新代码,一切都开始正常工作了。
我使用 @auth0/angular-jwt
和 angular 解决了这个问题 6. 您首先需要完全卸载 angular2-jwt:
npm uninstall angular2-jwt --save
那么你可以运行:
npm install @auth0/angular-jwt
只有这两个命令行帮助了我。祝一切顺利。