Angular 2 Customization Using Angular -CLI

I followed the steps from angular.io to install angular-cli and create a basic project. He cannot service or build every time. I removed npm, node, all node dep. nothing yet. Getting the same error using different versions of angular-cli (beta28).

My ng -v

@angular/cli: 1.0.0-rc.1
node: 6.10.0
os: darwin x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

Errors I get:

ERROR in multi ./src/styles.css
Module not found: Error: Can't resolve 'style-loader' in '/Users/sebastian/workspace/ellipsis/frontend'
 @ multi ./src/styles.css

ERROR in multi ./src/main.ts
Module not found: Error: Can't resolve '@ngtools/webpack' in '/Users/sebastian/workspace/ellipsis/frontend'
 @ multi ./src/main.ts

ERROR in multi ./src/polyfills.ts
Module not found: Error: Can't resolve '@ngtools/webpack' in '/Users/sebastian/workspace/ellipsis/frontend'
     @ multi ./src/polyfills.ts
ERROR in   Error: Child compilation failed:
  Entry module not found: Error: Can't resolve 'raw-loader' in '/Users/sebastian/workspace/ellipsis/frontend':
  Error: Can't resolve 'raw-loader' in '/Users/sebastian/workspace/ellipsis/frontend'

So, I installed all the necessary modules one at a time. But what am I left with another error, which is no longer a missing module.

I do not think it is necessary to install these modules one at a time. What am I missing here?

Launch OSX Sierra

+4
source share
4 answers

use @angular/cliinstead

npm uninstall angular-cli

npm cache clean

npm install @angular/cli

ng new myApp

ng serve
+2
source

, rc- cli, , , , -

"angular-cli": "1.0.0-beta.21",
"@angular/common": "~2.4.1",
"@angular/compiler": "~2.4.1",
"@angular/core": "~2.4.1",
"@angular/forms": "~2.4.1",
"@angular/http": "~2.4.1",
"@angular/platform-browser": "~2.4.1",
"@angular/platform-browser-dynamic": "~2.4.1",
"@angular/router": "~3.1.0",
+1

I believe that if you clean the node modules and install everything, everything should work fine.

0
source

If you have an older version of Node.js installed, then install the latest version .it will update the old version, but will still link to the old links.

The solution to this problem is to remove the old version of Node.js from add / remove programs and install a fresh copy of the latest Node.js. then run the command "npm install -g @ angular / cli". he will install the CLI components.

0
source

Source: https://habr.com/ru/post/1671751/


All Articles