angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.97k forks source link

I face the error while running the commands npm install -g angualr-cli@webpack i have node -v 6 npm 3 but still the error plzzz help #1919

Closed AnasSharif closed 8 years ago

AnasSharif commented 8 years ago

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
  2. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
  4. The log given by the failure. Normally this include a stack trace and some more information.
  5. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

crain commented 8 years ago

What is the exact error?

ghost commented 8 years ago

OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

MacbookPRO / El Capitan

$ node --version
v6.5.0

$ npm --version
3.10.3

$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64

Repro steps. Was this an app that wasn't created using the CLI? What change did you

do on your code? etc. Using the above configuration I executed the following steps

$ ng build my_project
$ cd my_project
$ ng build

The log given by the failure. Normally this include a stack trace and some

more information.

This issue seems to be related to issue #1873

It has been suggested that upgrading to node 6.5.0 might solve the problem. Unfortunately, as shown by the logs below, this is not the case:

$ node --version
v6.5.0

$ npm --version
3.10.3

$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64

$ ng build
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
1019ms building modules                                                              
1ms sealing 
0ms optimizing 
1ms basic module optimization 
1ms module optimization 
0ms advanced module optimization 
2ms basic chunk optimization        
1ms chunk optimization 
0ms advanced chunk optimization 
0ms module and chunk tree optimization 
3ms module reviving 
0ms module order optimization 
0ms module id optimization 
1ms chunk reviving 
0ms chunk order optimization 
1ms chunk id optimization 
2ms hashing 
0ms module assets processing 
6ms chunk assets processing 
1ms additional chunk assets processing 
0ms recording 
1ms additional asset processing 
76ms chunk asset optimization
193ms asset optimization
4ms emitting 
Hash: 8633515b4611dd25238a
Version: webpack 2.1.0-beta.21
Time: 1329ms
            Asset       Size  Chunks             Chunk Names
   main.bundle.js    19.3 kB    0, 2  [emitted]  main
 styles.bundle.js      13 kB    1, 2  [emitted]  styles
        inline.js    5.53 kB       2  [emitted]  inline
         main.map    15.4 kB    0, 2  [emitted]  main
       styles.map    17.9 kB    1, 2  [emitted]  styles
       inline.map    5.59 kB       2  [emitted]  inline
       index.html  481 bytes          [emitted]  
assets/.npmignore    0 bytes          [emitted]  
chunk    {0} main.bundle.js, main.map (main) 13.8 kB {1} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.map (styles) 12.7 kB {2} [initial] [rendered]
chunk    {2} inline.js, inline.map (inline) 0 bytes [entry] [rendered]

ERROR in ./src/main.ts
Module not found: Error: Can't resolve '@angular/platform-browser-dynamic' in '/Users/silveir/Projects/studies/ng2_router/src'
 @ ./src/main.ts 2:0-75
 @ multi main

.... many more errors of this nature

Mention any other details that might be useful.

Ive tried the steps above with many different typescript versions

borntodesign commented 8 years ago

Try ng init and look over the merge files again to check the package.json file. You should have the RC5 version of @angular/platform-browser-dynamic installed so you can get the correct browser module.

ghost commented 8 years ago

I did, it does not solve the problem:

$ cat package.json 
{
  "name": "ng2-router",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "core-js": "^2.4.0",
    "rxjs": "5.0.0-beta.11",
    "ts-helpers": "^1.1.1",
    "zone.js": "0.6.12"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.11-webpack.8",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.3",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "^2.0.0"
  }
}
ghost commented 8 years ago

Good News. Replacing "typescript": "^2.0.0" with "typescript": "2.0.0" worked!

borntodesign commented 8 years ago

Congrats!

On Wednesday, 31 August 2016, Rodrigo Silveira notifications@github.com wrote:

Good News. Replacing "typescript": "^2.0.0" with "typescript": "2.0.0" worked!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1919#issuecomment-243815890, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUSGiQg7iGCjb_JmeNN97ZQiqAnYzKSks5qlaf0gaJpZM4JxlAo .

ghost commented 8 years ago

For the record, this is my current configuration

$ node --version
v6.5.0
$ npm --version
3.10.3
$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64

$ npm list -g
/usr/local/lib
├─┬ angular-cli@1.0.0-beta.11-webpack.8
│ ├── @angular-cli/ast-tools@1.0.0

...

├── typescript@2.0.0

....
ev45ive commented 8 years ago

So, does "1.0.0-beta.11-webpack.8" is "the version" @dematic-rodrigo-silveira ? Does it work fine for you? What OS? I need basic stuff working to showcase new stuff like NgModule and webpack. Will that version do?

I tried previous version and there was problems with typescript. It either complained with npm. Updated to 3 and worked, but then when I did "ng serve" app started with a lot of errors in console for missing type definitions like:

ERROR in [default] 
Cannot find global type 'Array'.

ERROR in [default] 
Cannot find global type 'Boolean'.

ERROR in [default] 
Cannot find global type 'Function'.

and so on.. tried adding typing with triple slash reference, tried using typings in tsconfig, tried changing typings/*.. but nothing helped..

What are steps to get Webpack rc5 with TS2.0 working ?

Thanks Much :-)

ghost commented 8 years ago

What we have at the moment is a fluid situation; until it settles we will be experimenting and sharing our observations, as I'm doing on this post. To clarify, after upgrading to 1.0.0-beta.11-webpack.8 recently I, and many others in the community, experienced variety of errors, mostly characterized by error messages during ng build and ng serve indicating that basic modules like @agular/core could not be found. Earlier this morning, collecting notes recorded in issues in this project, I cobbled an environment that is working for me:

My tools

 node --version
v6.5.0
$ npm --version
3.10.3
$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64

$ npm list -g
/usr/local/lib
├─┬ angular-cli@1.0.0-beta.11-webpack.8
│ ├── @angular-cli/ast-tools@1.0.0

...

├── typescript@2.0.0

....

Typescript and packages.json

Changed typescript": "^2.0.0" to "typescript": "2.0.0" in my packages.json

Executed the following commands on my project root

$ rm -rf node_modules dist tmp typings
$ npm install --save-dev angular-cli@webpack

Good luck!

billdwhite commented 8 years ago

Now that the newly released RC6 requires typescript 2.0.2, angular-cli will not work with it until it also supports 2.0.2

GRRedWings commented 8 years ago

@billdwhite - You say that RC6 requires 2.0.2, can we still use RC5 with 2.0.0? I'm struggling with this same problem and had it working with RC5, but now that I'm trying to set it up on another Windows machine I can't get it to build.

filipesilva commented 8 years ago

The original issue seems to be a dupe of https://github.com/angular/angular-cli/issues/1919#issuecomment-243763329.

Not really sure where the followup replies came from since the main post contains 0 information, but please open new issues if your problems persist.

The typescript@2.0.2 issue was fixed though.

angular-automatic-lock-bot[bot] commented 5 years ago

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.