building server in universal story - Error: Can't resolve 'ts-loader'
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.4.5 node: 8.6.0 os: linux x64 @angular/animations: 4.4.4 @angular/common: 4.4.4 @angular/compiler: 4.4.4 @angular/core: 4.4.4 @angular/forms: 4.4.4 @angular/http: 4.4.4 @angular/platform-browser: 4.4.4 @angular/platform-browser-dynamic: 4.4.4 @angular/platform-server: 4.4.4 @angular/router: 4.4.4 @angular/cli: 1.4.5 @angular/compiler-cli: 4.4.4 @angular/language-service: 4.4.4 typescript: 2.3.4
Repro steps.
- Follow the universal story to setup existing angular-cli project to universal.
- Run the command to build the universal server.
webpack --config webpack.server.config.js --progress --colors
The log given by the failure.
webpack --config webpack.server.config.js --progress --colors
Hash: eb41d9b8aea4d4f2ca58
Version: webpack 3.6.0
Time: 32ms
ERROR in Entry module not found: Error: Can’t resolve ‘ts-loader’ in <some project>
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! poc@0.0.0 webpack:server: webpack --config webpack.server.config.js --progress --colors
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the poc@0.0.0 webpack:server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /home/eyal/.npm/_logs/2017-10-11T05_21_36_973Z-debug.log eyal@eyal-ThinkPad-X270:~/poc$ npm i ts-loader npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
- ts-loader@2.3.7 added 115 packages in 6.207s
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
I have solved this by doing
npm i ts-loader
. Just wanted to know if this is the right course of action and/or something in the universal doc is missing.@elpdrc @hiepxanh via #8012 Thanks for pointing this one out, I must of overlooked it! 👍