I have copied a project in a new repository.
Then I tried to delete node_modules folder then tape :
npm install
to install missing dependencies
But after installation and when I run my project using angular-CLI it does not find modules and show this errors:
ERROR in /home/haddad/projects/portfolio/src/app/app.component.ts (1,62): Cannot find module '@angular/core'.
ERROR in /home/haddad/projects/portfolio/src/app/app.component.ts (2,54): Cannot find module 'ngx-fullpage'.
ERROR in /home/haddad/projects/portfolio/src/app/menu-accueil/menu-accueil.component.ts (2,31): Cannot find module '@angular/material'.
Here's my package.json
{
"name": "siteperso",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.6",
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/flex-layout": "^2.0.0-beta.8",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/material": "^2.0.0-beta.8",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"angular2-fontawesome": "^0.9.1",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"ngx-fullpage": "^4.0.6",
"particlesjs": "^2.0.2",
"roboto-fontface": "^0.8.0",
"rxjs": "^5.1.0",
"typed.js": "^2.0.2",
"typeit": "^4.4.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.2.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"angular-ide": "^0.9.29",
"codelyzer": "~3.0.1",
"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",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
I have also uninstall angular-cli then reinstall it back but no result .
UPDATE , I have noticed that the missing modules are the locked directory @angular in node_modules folder.
even after using sudo chown -R ./node_modules/
I got the same error