platform icon indicating copy to clipboard operation
platform copied to clipboard

have error : ERROR in node_modules/@ngrx/store/src/store.d.ts(30,31): error TS2304: Cannot find name 'Extract'.

Open alexkoretzki opened this issue 7 years ago • 14 comments

this is my dependencies

{ "name": "ngrx-test", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^6.0.2", "@angular/common": "^6.0.2", "@angular/compiler": "^6.0.2", "@angular/core": "^6.0.2", "@angular/forms": "^6.0.2", "@angular/http": "^6.0.2", "@angular/platform-browser": "^6.0.2", "@angular/platform-browser-dynamic": "^6.0.2", "@angular/router": "^6.0.2", "@ngrx/store": "^7.0.0", "core-js": "^2.5.4", "rxjs": "^6.0.0", "zone.js": "^0.8.26" }, "devDependencies": { "@angular/compiler-cli": "^6.0.2", "@angular-devkit/build-angular": "~0.6.3", "typescript": "*", "@angular/cli": "~6.0.3", "@angular/language-service": "^6.0.2", "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~1.4.2", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tslint": "~5.9.1" } }

alexkoretzki avatar Dec 27 '18 09:12 alexkoretzki

What version of typescript are you on? (run ng --version to get the installed deps)

timdeschryver avatar Dec 27 '18 10:12 timdeschryver

I am having the same exact same error and my ng --version is the following:

Angular CLI: 6.1.5 Node: 10.5.0 OS: darwin x64 Angular: 6.1.10 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 0.7.5 @angular/cli 6.1.5 @angular/tsc-wrapped 0.5.2 @ngtools/json-schema 1.1.0 @ngtools/webpack 6.1.5 @schematics/angular 0.7.5 @schematics/update 0.7.5 rxjs 6.3.3 typescript 2.7.2 webpack 4.9.2

kronus avatar Dec 31 '18 13:12 kronus

Extract is introduced in Typescript 2.8. Which explains the errors.

Upgrade TypeScript (I think you should also upgrade Angular in order to get it fully working) and it should be fine.

If not you can re-open this issue.

timdeschryver avatar Dec 31 '18 13:12 timdeschryver

Thank you @timdeschryver I have updated to the latest, but I am still receiving the same error: tsc --version Version 3.2.2

ERROR in node_modules/@ngrx/store/src/store.d.ts(30,31): error TS2304: Cannot find name 'Extract'.

I would update Angular to the latest, but I have rule about not updating while in the middle of working on a project. If there are no other suggestions, then I will wait until the project is complete, followed by updating to the latest Angular

Thanks in advance

kronus avatar Jan 02 '19 19:01 kronus

The tsc --version is probably the global typescript version. The typescript in the Angular project should be updated.

timdeschryver avatar Jan 02 '19 20:01 timdeschryver

@timdeschryver sorry, I am still a newbie at all of this. How do I found what the version is for my project.

Also, Happy New Year to you and yours

kronus avatar Jan 02 '19 23:01 kronus

@kronus by running ng --version like you did previously, typescript is listed as typescript 2.7.2 in your previous comment.

timdeschryver avatar Jan 03 '19 06:01 timdeschryver

try to check the typescript version of your project deps by running npm ls typescript

npm -i typescript@{{ highest typescript version on your project deps }} --save

MarkJAmes1217 avatar Jan 07 '19 10:01 MarkJAmes1217

@MarkJAmes1217 - thank you for replying.

I ran npm ls typescript and the following is the result: MacBook-Pro:oshop tam3$ npm ls typescript [email protected] /Applications/MAMP/htdocs/oshop ├─┬ @angular-devkit/[email protected] │ └─┬ @angular-devkit/[email protected] │ └── [email protected] ├─┬ @angular/[email protected] │ └─┬ @schematics/[email protected] │ └── [email protected] deduped ├─┬ @ng-bootstrap/[email protected] │ └── [email protected] deduped ├─┬ [email protected] │ ├─┬ @angular-cli/[email protected] │ │ └── [email protected] │ └── [email protected] └── [email protected]

Followed by sudo npm i [email protected] --save and I received the access warnings. I do not understand what I am missing.

ERR! path /Applications/MAMP/htdocs/oshop/node_modules/@ng-bootstrap/schematics/node_modules/typescript/bin/tsc npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall chmod npm ERR! enoent ENOENT: no such file or directory, chmod '/Applications/MAMP/htdocs/oshop/node_modules/@ng-bootstrap/schematics/node_modules/typescript/bin/tsc' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: npm ERR! /Users/tam3/.npm/_logs/2019-01-08T00_18_51_254Z-debug.log

kronus avatar Jan 08 '19 00:01 kronus

try to delete the node modules folder and run npm i

MarkJAmes1217 avatar Jan 08 '19 02:01 MarkJAmes1217

@MarkJAmes1217 , thanks for your help. I had to run sudo npm i --unsafe-perm --verbose to avoid all the EACCES errors

ng --verison: / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / △ \ | '_ \ / _ | | | | |/ ` | '__| | | | | | | / ___ | | | | (| | || | | (| | | | || | | | // __| ||_, |_,||_,|| _||| |___/

Angular CLI: 6.1.0 Node: 10.15.1 OS: darwin x64 Angular: 6.1.10 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 0.7.0 @angular/cli 6.1.0 @angular/platform-server 4.4.7 @angular/tsc-wrapped 0.5.2 @ngtools/json-schema 1.1.0 @ngtools/webpack 6.1.5 @schematics/angular 0.7.0 @schematics/update 0.7.0 rxjs 6.0.0 typescript 2.9.2 webpack 4.6.0`

I am still seeing the same error:

ERROR in node_modules/@ngrx/store/src/store.d.ts(30,31): error TS2304: Cannot find name 'Extract'.

kronus avatar Feb 04 '19 20:02 kronus

Angular 6 uses typescript from 2.7.2 until 2.8.0, ngrx 7 uses 2.8.0 and above, so there is a conflict here. I fixed the problem by downgrading ngrx to version 6. I could have updated angular to version 7 but that would be more time consuming.

maudzekod4000 avatar Feb 13 '19 14:02 maudzekod4000

this seems to be a persistent issue with latest angular/ngrx

MEANSTACKDIGITAL avatar Apr 03 '19 22:04 MEANSTACKDIGITAL

@Vallerious suggestion of downgrading to rxjs 6 worked for me (thanks!)

AnastasiusVivaldus avatar Jan 21 '20 05:01 AnastasiusVivaldus