Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alexkoretzki opened this issue Dec 27, 2018 · 14 comments

Comments

@alexkoretzki
Copy link

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"
}
}

@timdeschryver
Copy link
Member

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

@kronus
Copy link

kronus commented Dec 31, 2018

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

@timdeschryver
Copy link
Member

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.

@kronus
Copy link

kronus commented Jan 2, 2019

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

@timdeschryver
Copy link
Member

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

@kronus
Copy link

kronus commented Jan 2, 2019

@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

@timdeschryver
Copy link
Member

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

@MarkJAmes1217
Copy link

MarkJAmes1217 commented Jan 7, 2019

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

@kronus
Copy link

kronus commented Jan 8, 2019

@MarkJAmes1217 - thank you for replying.

I ran npm ls typescript and the following is the result:
MacBook-Pro:oshop tam3$ npm ls typescript
oshop@0.0.0 /Applications/MAMP/htdocs/oshop
├─┬ @angular-devkit/build-angular@0.7.5
│ └─┬ @angular-devkit/build-optimizer@0.7.5
│ └── typescript@2.9.2
├─┬ @angular/cli@6.1.5
│ └─┬ @schematics/angular@0.7.5
│ └── typescript@2.7.2 deduped
├─┬ @ng-bootstrap/schematics@2.0.0-alpha.1
│ └── typescript@2.7.2 deduped
├─┬ angular-cli@1.0.0-beta.28.3
│ ├─┬ @angular-cli/ast-tools@1.0.16
│ │ └── typescript@2.0.10
│ └── typescript@2.0.10
└── typescript@2.7.2

Followed by sudo npm i typescript@2.9.2 --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

@MarkJAmes1217
Copy link

try to delete the node modules folder and run npm i

@kronus
Copy link

kronus commented Feb 4, 2019

@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'.

@pancanin
Copy link

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.

@nhhockeyplayer
Copy link

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

@MagnusBrzenk
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants