Closed siva636 closed 8 years ago
try install npm install -g angular-cli@1.0.0-beta.11-webpack.8
have the same issue, but according to this thread #1883 you now need node6 and not node4
Updating node from 6.3.0 to 6.5.0 helped me too for this problem.
to fix this u need go ng init, coz angular-cli.json was modify !! need to write about it on changelog !!.
go ng init, and go yes only for angular-cli.json and polyfills.ts
I' trying the new angular-cli: 1.0.0-beta.11-webpack.8 ...
System: Mac OSX El Capitan
$ 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. ng new projname cd projname ng serve
Errors Project is running but the console reports tons of typings errors like the followings
ERROR in [default] /Users/user/webProjects/test-angular2/webpack/node_modules/@angular/core/src/di/reflective_key.d.ts:18:11 Cannot find name 'Object'.
ERROR in [default] /Users/user/webProjects/test-angular2/webpack/node_modules/@angular/core/src/di/reflective_key.d.ts:23:23 Cannot find name 'Object'.
ERROR in [default] /Users/user/webProjects/test- angular2/webpack/node_modules/@angular/core/src/di/reflective_key.d.ts:31:22 Cannot find name 'Object'.
ERROR in [default] /Users/user/webProjects/test-angular2/webpack/node_modules/@angular/core/src/di/reflective_provider.d.ts:71:13 Cannot find name 'Function'.
ERROR in [default] /Users/user/webProjects/test-angular2/webpack/node_modules/@angular/core/src/di/reflective_provider.d.ts:80:17 Cannot find name 'Function'.
This morning things were fine. Now when I create a project and run ng build or ng serve I observe all these errors.
Running on a MacbookPro / El Capitan: 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.2.1 os: darwin x64
Additional Note: The app runs, regardless. Kind of hard to debug though!
Why in CHANGELOG.md the newest version is 1.0.0-beta.11-webpack.3 but everyone is installing 1.0.0-beta.11-webpack.8?
angular-cli@1.0.0-beta.11-webpack.8 is what is installed with one installs angular-cli@webpack, which is recommended in the angular-cli installation page for RC5 / webpack.
it is a moving target! Hopefully this is a better version. I'll check it out right now and let you know what I observe.
I had really strange situation.
I run npm install -g angular-cli@webpack
Than I checked the version ng -v
and it was angular-cli 1.0.0-beta.10
I decided to remove it npm uninstall angular-cli
, than npm cache clean
.
To ensure that it's deleted I run one more time ng -v
and for my surprise the version was 1.0.0-beta.11-webpack.8
I don't have any idea what just happened
I love it! I just finished the same exercise and got 1.0.0-beta.11-webpack.8
! I guess you had an optical illusion (happens to me lot, particularly while playing chess!). Tje problem with the typings still remains.
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
do on your code? etc. Using the above configuration I executed the following steps
$ ng build my_project
$ cd my_project
$ ng build
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
Ive tried the steps above with many different typescript versions
I was able to solve this problem with the following 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
....
to
"typescript": "2.0.0"in my
packages.json`$ rm -rf node_modules dist tmp typings
$ npm install --save-dev angular-cli@webpack
Thanks @dematic-rodrigo-silveira Changing "typescript": "^2.0.0"to "typescript": "2.0.0"in packages.json works
Now i've upgraded the structure of my project comparing folders and files from a fresh ng new project, there are several differences. Now i've got this errors and i can't figure out where to remove undefined from the path see the errors below
ERROR in multi main
Module not found: Error: Can't resolve '/Users/user/webProjects/musicollector/undefined/main.ts' in '/Users/user/webProjects/musicollector/node_modules/angular-cli/addon/ng2/models'
@ multi main
ERROR in Entry module not found: Error: Can't resolve '/Users/user/webProjects/musicollector/undefined/polyfills.ts' in '/Users/user/webProjects/musicollector/node_modules/angular-cli/addon/ng2/models'
ERROR in Error: Child compilation failed:
Entry module not found: Error: Can't resolve '/Users/user/webProjects/musicolle ctor/undefined/index.html' in '/Users/user/webProjects/musicollector/node_modul es/angular-cli/addon/ng2/models':
Error: Can't resolve '/Users/user/webProjects/musicollector/undefined/index.htm l' in '/Users/user/webProjects/musicollector/node_modules/angular-cli/addon/ng2 /models'
Thanks @dematic-rodrigo-silveira also, as @kurtommy said, no more typings errors appear. But, I still have issues with MS Visual Code and intellisense.
With:
$ nvm use v4
$ ng --version
angular-cli: 1.0.0-beta.10
node: 4.5.0
os: darwin x64
$ npm --version
3.10.7
$ npm cache clean
$ ng new test-10
$ code test-10
it works perfectly, as expected.
With:
$ nvm use v6
$ ng --version
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64
$ npm --version
3.10.7
$ tsc --version
Version 2.0.0
$ npm cache clean
$ ng new test-11
$ code test-11
MS Studio Code reports some problems (although it is compiled ok):
[ts] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning. [ts] Cannot find name 'Promise'.
¿Any idea?
As it was mentioned before you should do next steps to fix this bug:
npm uninstall typescript -g
npm cache clean
npm install typescript@2.0.0 -g
ng init
in project folder"typescript": "^2.0.0"
to "typescript": "2.0.0"
in package.jsonnpm install
For me it works good.
Versions:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64
Nop. ng serve
does not throw any error, but MS Visual Code still reporting the same errors.
When the next version of CLI likely to come out?
Closing as obsolete.
@siva636 please try the latest beta.14.
The typescript@^2.0.0 - >2.0.0
issue was fixed in https://github.com/angular/angular-cli/pull/1993.
Errors in your editors are because they might not support typescript 2.0.0 yet, there might be a way to configure the editor but it varies.
For other problems please open separate issues.
Now (beta.14) it is working ok (like beta.10) with MS Visual Code. (may be is the editor that has been updated to v1.5.2) Thanks @filipesilva
I think the error is stable (ng serve, ng build) repeats when name of the parent folder have somewhere symbol ! (ex. C:/!my-folder). When I renamed it (C:/my-folder) I got success.
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.
in a Terminal:
node --version
and paste the result here: