angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

building server in universal story - Error: Can't resolve 'ts-loader'

Open elpdrc opened this issue 9 years ago • 5 comments

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.

  1. Follow the universal story to setup existing angular-cli project to universal.
  2. 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 npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] webpack:server: 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"})

elpdrc avatar Oct 11 '17 05:10 elpdrc

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 avatar Oct 11 '17 05:10 elpdrc

agree, doc is misssing

hiepxanh avatar Oct 11 '17 13:10 hiepxanh

@elpdrc @hiepxanh via #8012 Thanks for pointing this one out, I must of overlooked it! 👍

MarkPieszak avatar Oct 11 '17 23:10 MarkPieszak

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).

wis avatar Nov 04 '17 18:11 wis

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.