npm start failed with error TS2305: Module '"{folder path}/node_modules/@angular/core/index"' has no exported member 'Component'.
See original GitHub issueHi I am facing an issue while starting angular\quickstart . if i try after deleting app folder, then npm start is running the lite-server.
following are the version details. node -v = v6.3.1 npm -v = 3.10.5 tsc -v Version 1.8.10 typings -v 1.3.2
E:\Work\angularjs\1ng2-myproj1>npm start
angular2-quickstart@1.0.0 start E:\Work\angularjs\1ng2-myproj1 tsc && concurrently “tsc -w” “lite-server”
app/app.component.ts(1,10): error TS2305: Module ‘“E:/Work/angularjs/1ng2-myproj1/node_modules/@angular/core/index”’ has no exported member ‘Component’. node_modules/@angular/core/index.d.ts(13,15): error TS2307: Cannot find module ‘./src/metadata’. node_modules/@angular/core/index.d.ts(14,15): error TS2307: Cannot find module ‘./src/util’. node_modules/@angular/core/index.d.ts(15,15): error TS2307: Cannot find module ‘./src/di’. …
other observations There is index.js file is available in “node_modules/@angular/core/index”. src folder is NOT available in “node_modules/@angular/core/” src folder is available “node_modules/@angular/core/esm”
E:\Work\angularjs\1ng2-myproj1\npm-debug.log 0 info it worked if it ends with ok 1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’, 1 verbose cli ‘C:\Users\jobyj\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js’, 1 verbose cli ‘start’ ] 2 info using npm@3.10.5 3 info using node@v6.3.1 4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ] 5 info lifecycle angular2-quickstart@1.0.0~prestart: angular2-quickstart@1.0.0 6 silly lifecycle angular2-quickstart@1.0.0~prestart: no script for prestart, continuing 7 info lifecycle angular2-quickstart@1.0.0~start: angular2-quickstart@1.0.0 8 verbose lifecycle angular2-quickstart@1.0.0~start: unsafe-perm in lifecycle true 9 verbose lifecycle angular2-quickstart@1.0.0~start: PATH: C:\Users\jobyj\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;E:\Work\angularjs\1ng2-myproj1\node_modules.bin;C:\Program Files\nodejs;C:\Users\jobyj\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\jobyj.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\jobyj\AppData\Roaming\npm 10 verbose lifecycle angular2-quickstart@1.0.0~start: CWD: E:\Work\angularjs\1ng2-myproj1 11 silly lifecycle angular2-quickstart@1.0.0~start: Args: [ ‘/d /s /c’, 'tsc && concurrently “tsc -w” “lite-server” ’ ] 12 silly lifecycle angular2-quickstart@1.0.0~start: Returned: code: 2 signal: null 13 info lifecycle angular2-quickstart@1.0.0~start: Failed to exec start script 14 verbose stack Error: angular2-quickstart@1.0.0 start:
tsc && concurrently "tsc -w" "lite-server"
14 verbose stack Exit status 2 14 verbose stack at EventEmitter.<anonymous> (C:\Users\jobyj\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:242:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess.<anonymous> (C:\Users\jobyj\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:852:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 15 verbose pkgid angular2-quickstart@1.0.0 16 verbose cwd E:\Work\angularjs\1ng2-myproj1 17 error Windows_NT 10.0.10586 18 error argv “C:\Program Files\nodejs\node.exe” “C:\Users\jobyj\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “start” 19 error node v6.3.1 20 error npm v3.10.5 21 error code ELIFECYCLE 22 error angular2-quickstart@1.0.0 start:tsc && concurrently "tsc -w" "lite-server"
22 error Exit status 2 23 error Failed at the angular2-quickstart@1.0.0 start script 'tsc && concurrently “tsc -w” “lite-server” '. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the angular2-quickstart package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error tsc && concurrently “tsc -w” “lite-server” 23 error You can get information on how to open an issue for this project with: 23 error npm bugs angular2-quickstart 23 error Or if that isn’t available, you can get their info via: 23 error npm owner ls angular2-quickstart 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
Try to install:
I had the same errors by migration from Angular 5.2.10 to 6.0.0 and It has solved the problem. Here you’ll find more information: https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md Good Luck!)
Hm. Your error seems to indicate some problem during the npm install. It’s basically saying that one of your libs is broken (in this case,
angular
itself).Can you delete
node_modules
and donpm install
again? If that’s the problem, it should fix it.