building server in universal story - Error: Can't resolve 'ts-loader'
Bug 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 webpack --config webpack.server.config.js --progress --colors
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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: [email protected] (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
- [email protected] added 115 packages in 6.207s
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.
agree, doc is misssing
@elpdrc @hiepxanh via #8012 Thanks for pointing this one out, I must of overlooked it! 👍
as @elpdrc said, installing ts-loader like that, can fix it.
I think that's why I got this issue, the CLI has ts-loader as a dependency, and I installed a previous version, 3.0.x the CLI depends on a later version (CLI 5.0.0 -> 3.1.1).
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.