angular / angular

Deliver web apps with confidence 🚀
https://angular.dev
MIT License
95.78k stars 25.29k forks source link

Error: Could not resolve module @angular/core at StaticSymbolResolver.getSymbolByModule #24954

Closed manzerProgen001 closed 6 years ago

manzerProgen001 commented 6 years ago

When running command 'npm start' getting error as below:-

ERROR in Error: Could not resolve module @angular/core at StaticSymbolResolver.getSymbolByModule (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@angular\compiler\bundles\compiler.umd.js:25763:30) at StaticReflector.findDeclaration (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@angular\compiler\bundles\compiler.umd.js:24512:63) at StaticReflector.initializeConversionMap (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@angular\compiler\bundles\compiler.umd.js:24730:36) at new StaticReflector (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@angular\compiler\bundles\compiler.umd.js:24472:14) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@angular\compiler-cli\src\ngtools_api.js:90:31) at AotPlugin._getLazyRoutesFromNgtools (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@ngtools\webpack\src\plugin.js:240:66) at _donePromise.Promise.resolve.then.then.then.then.then (D:\Users\ansarif\Documents\projects\git\gitpull Updated\git Pull and Merge\pi3_GIT_Pull_Merge-----\Git_Test_Working\Progen-pi-UI_20180718_2PM\node_modules@ngtools\webpack\src\plugin.js:493:24) at at process._tickCallback (internal/process/next_tick.js:160:7) at Function.Module.runMain (module.js:703:11) at startup (bootstrap_node.js:190:16) at bootstrap_node.js:662:3 Child html-webpack-plugin for "index.html": 1 asset [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 1.01 kB {0} [built] webpack: Failed to compile.


Angular CLI: 1.6.3 (e) Node: 9.5.0 OS: win32 x64 Angular: 4.4.3 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router, tsc-wrapped

@angular/cdk: 5.1.1 @angular/cli: 1.6.3 @angular/material: 5.1.1 @angular/platform-webworker-dynamic: 6.0.9 @angular/platform-webworker: 6.0.9 @angular-devkit/build-optimizer: 0.0.36 @angular-devkit/core: 0.6.8 @angular-devkit/schematics: 0.0.40 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.10.2 @schematics/angular: 0.1.11 @schematics/schematics: 0.0.10 typescript: 2.6.2 webpack-dev-server: 2.9.7 webpack: 3.10.0

Packge.json

{ "name": "pi3", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "webpack-dev-server --port=4200", "build": "webpack", "test": "karma start ./karma.conf.js", "lint": "ng lint", "e2e": "protractor ./protractor.conf.js", "pree2e": "webdriver-manager update --standalone false --gecko false --quiet", "compile": "webpack --config webpack.config.js" }, "private": true, "dependencies": { "@angular-devkit/core": "^0.6.8", "@angular-devkit/schematics": "0.0.40", "@angular/animations": "^4.2.4", "@angular/cdk": "^5.1.1", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/material": "^5.1.1", "@angular/platform-browser": "^4.2.4", "@angular/platform-browser-dynamic": "^4.2.4", "@angular/platform-webworker": "^6.0.9", "@angular/platform-webworker-dynamic": "^6.0.9", "@angular/router": "^4.2.4", "@auth0/angular-jwt": "^1.1.0", "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5", "@ngtools/webpack": "^1.5.1", "@types/d3": "^4.7.0", "@types/d3-sankey": "^0.7.2", "angular-2-dropdown-multiselect": "^1.6.0", "angular2-grid": "^2.0.7", "angular2-multiselect-dropdown": "^1.3.0", "angular2gridster": "^1.2.0", "c3": "^0.4.18", "core-js": "^2.4.1", "d3": "^4.10.2", "d3-sankey": "^0.7.1", "datamaps": "^0.5.8", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", "jwt-decode": "^2.2.0", "primeng": "^4.2.2", "rxjs": "^5.5.6", "topojson": "^3.0.2", "ts-helpers": "^1.1.1", "ts-topojson": "0.0.11", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "^1.5.5", "@angular/compiler-cli": "^4.2.4", "@angular/language-service": "^4.2.4", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.1.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "^2.0.4", "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.3.2", "ts-node": "~3.2.0", "tslint": "~5.3.2", "typescript": "^2.3.4", "webpack-dev-server": "~2.9.3", "webpack": "~3.10.0", "autoprefixer": "^6.5.3", "css-loader": "^0.28.1", "cssnano": "^3.10.0", "exports-loader": "^0.6.3", "file-loader": "^1.1.5", "html-webpack-plugin": "^2.29.0", "less-loader": "^4.0.5", "postcss-loader": "^2.0.8", "postcss-url": "^7.1.2", "raw-loader": "^0.5.1", "sass-loader": "^6.0.3", "source-map-loader": "^0.2.0", "istanbul-instrumenter-loader": "^2.0.0", "style-loader": "^0.13.1", "stylus-loader": "^3.0.1", "url-loader": "^0.6.2", "circular-dependency-plugin": "^4.2.1", "copy-webpack-plugin": "^4.1.1", "uglifyjs-webpack-plugin": "^1.1.5" } }

angular-cli.json

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "name": "pi3", "ejected": true }, "apps": [ { "root": "src", "outDir": "pi3", "assets": [ "assets", "favicon.ico", "assets/images/hp_logo2.png" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ "assets/css/bootstrap-3.3.7.min.css", "../node_modules/font-awesome/css/font-awesome.min.css", "../node_modules/primeng/resources/primeng.min.css", "../node_modules/primeng/resources/themes/omega/theme.css", "../node_modules/c3/c3.min.css", "styles.css", "theme.css", "charts.css" ], "scripts": [ "../node_modules/hammerjs/hammer.min.js" ], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "project": "src/tsconfig.app.json" }, { "project": "src/tsconfig.spec.json" }, { "project": "e2e/tsconfig.e2e.json" } ], "test": { "karma": { "config": "./karma.conf.js" } }, "defaults": { "styleExt": "css", "component": { } } } tsconfig.json

{ "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] } }

tsconfig.app.json

{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "baseUrl": "./", "module": "es2015", "types": [] }, "exclude": [ "test.ts", "*/.spec.ts" ] }

tsconfig.spec.json

{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/spec", "baseUrl": "./", "module": "commonjs", "target": "es5", "types": [ "jasmine", "node" ] }, "files": [ "test.ts" ], "include": [ "/.spec.ts", "/.d.ts" ] }

vicb commented 6 years ago

I'm sorry but we don't understand the problem you are reporting.

If the problem still exists please open a new issue and provide a plunker reproducing the problem and describing the difference between the expected and current behavior. You can use this plunker template: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5?p=catalogue

manzerahmad001 commented 6 years ago

Hi @Victor Berchet ,

I am trying to run "npm start" and my package.json(scripts) looks like below:-

package.json

"scripts": { "ng": "ng", "start": "webpack-dev-server --port=4200", "build": "webpack", "test": "karma start ./karma.conf.js", "lint": "ng lint", "e2e": "protractor ./protractor.conf.js", "pree2e": "webdriver-manager update --standalone false --gecko false --quiet", "compile": "webpack --config webpack.config.js" },

And error I am getting is:- ERROR in Error: Could not resolve module @angular/core at StaticSymbolResolver.getSymbolByModule

What does this error means and what I am missing? I think my question is very clear to understand . Please help if you have any idea regarding the issue.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.