Issue
From today we are having issues with deploying our project as in drone logs in build step we are receiving:
Error: node_modules/@types/node/ts4.8/crypto.d.ts:4477:13 - error TS2403: Subsequent variable declarations must have the same type. Variable 'crypto' must be of type 'Crypto', but here has type 'Crypto'.
4477 var crypto: webcrypto.Crypto; ~~~~~~ node_modules/typescript/lib/lib.dom.d.ts:18084:13
18084 declare var crypto: Crypto;
~~~~~~
'crypto' was also declared here.
Here are the project dependencies:
"dependencies": {
"@angular/animations": "^14.1.0",
"@angular/cdk": "^14.2.2",
"@angular/common": "^14.1.0",
"@angular/compiler": "^14.1.0",
"@angular/core": "^14.1.3",
"@angular/forms": "^14.1.0",
"@angular/localize": "^14.1.0",
"@angular/platform-browser": "^14.1.3",
"@angular/platform-browser-dynamic": "^14.1.0",
"@angular/router": "^14.1.3",
"@angular/service-worker": "^14.1.3",
"@ng-bootstrap/ng-bootstrap": "^13.0.0",
"@nrwl/angular": "15.7.2",
"@popperjs/core": "^2.10.2",
"angular-ng-stepper": "^2.0.0",
"bootstrap": "^5.2.0",
"bootstrap-icons": "^1.9.1",
"express": "^4.18.1",
"ngx-json-viewer": "^3.2.1",
"ngx-progressbar": "^9.0.0",
"ngx-spinner": "^14.0.0",
"ngx-toastr": "^15.0.0",
"path": "^0.12.7",
"rxjs": "~7.5.0",
"typescript": "~4.7.2",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.1.3",
"@angular-devkit/core": "^14.2.6",
"@angular-devkit/schematics": "^14.2.6",
"@angular/cli": "^14.2.6",
"@angular/compiler-cli": "^14.1.0",
"@nrwl/nx-cloud": "15.0.0",
"@nrwl/workspace": "15.7.2",
"@schematics/angular": "^14.2.11",
"@types/jasmine": "~4.0.0",
"@types/node": "^20.11.5",
"jasmine-core": "~4.2.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"nx": "15.7.2",
"prettier": "^2.8.4",
"tslib": "^2.4.0",
"typescript": "~4.7.2"
}
We saw that this issue has been reported on github: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/68379 but installing the @types/node@20.11.5 does not solve the issue...
Drone config for build:
commands:
- npm install
- npm run build-stage
How can we fix this issue as the issue is not happening when building the project locally..?
Thanks!
Solution
Wagner's answer should work. Just keep in mind that using a carat symbol (^) in your version "^20.11.5" means you are willing to accept any version of the dependency from 20.11.5 up to but not including 21.0.0. Try removing the carat from your dependency version to see if that works.
Answered By - Andres A
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.