You seem to not be depending on "@angular/core". Typescript
Solution 1
I encountered the same issue to resolve this all you need to do is to
cd <project_name>
and then run the following command:
npm update
and than the project will be succesfully compiled.
Solution 2
I have also faced the same issue while executing below command.
D:\My_Project>ng serve
Then I have followed below steps and it worked for me.
D:\My_Project>npm link
D:\My_Project>ng serve
Keep trying, good luck :)
Solution 3
This error occurred in my case when my node_modules folder is empty otherwise it will have bunch of folders inside. I used the "ng link" command to work it out.
My project name is Pipes, and my command prompt looks like this:
Pipes$ npm link
And finally you can execute ng serve to check it out
Solution 4
Try to remove node_modules
folder, package-lock.json
file and then run:
npm cache clean --force
npm cache verify
npm i
danio900409
Updated on July 09, 2022Comments
-
danio900409 almost 2 years
I'm trying to run a command at npm start, but I get the message: "You seem to be not dependent on" @angular/core ". This is an error. What could be the reason? As it writes in the console: npm @angular/core -v it gets 5.4.2
My package.json
"dependencies": { "@angular/animations": "^4.4.3", "@angular/common": "^4.4.3", "@angular/compiler": "^4.4.3", "@angular/core": "^4.4.3", "@angular/forms": "^4.4.3", "@angular/http": "^4.4.3", "@angular/platform-browser": "^4.4.3", "@angular/platform-browser-dynamic": "^4.4.3", "@angular/router": "^4.4.3", "applicationinsights-js": "^1.0.12", "core-js": "^2.4.1", "date-fns": "^1.28.5", "deepmerge": "^1.5.1", "fingerprintjs2": "^1.5.1", "ng2-page-scroll": "^4.0.0-beta.9", "ngx-mydatepicker": "2.1.2", "rxjs": "^5.1.0", "zone.js": "^0.8.12" }, "devDependencies": { "@angular/cli": "^1.4.2", "@angular/compiler-cli": "^4.4.3", "@angular/language-service": "^4.4.3", "@types/applicationinsights-js": "^1.0.4", "@types/deepmerge": "^1.3.2", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.0.1", "gulp": "^3.9.1", "gulp-deploy-git": "^0.5.3", "gulp-replace": "^0.6.1", "husky": "^0.14.3", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "lint-staged": "^4.0.3", "prettier": "^1.5.3", "protractor": "^5.1.2", "run-sequence": "^2.1.0", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "^2.5.2" }