angular-cli: Latest Webpack version of CLI throws error

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Ubuntu latest 16.04 LTS
  2. Versions. Please run ng --version. If there’s nothing outputted, please run When run ng --version the following error comes: siva@siva:~$ ng --version Error while running script "/home/siva/Applications/node-v4.4.3-linux-x86/lib/node_modules/angular-cli/addon/ng2/models/config/config.ts": SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.require.extensions..ts (/home/siva/Applications/node-v4.4.3-linux-x86/lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/home/siva/Applications/node-v4.4.3-linux-x86/lib/node_modules/angular-cli/addon/ng2/models/config.ts:7:16) at Module._compile (module.js:409:26) at Object.require.extensions..ts (/home/siva/Applications/node-v4.4.3-linux-x86/lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14)

in a Terminal: node --version and paste the result here:

  1. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
  2. The log given by the failure. Normally this include a stack trace and some more information.
  3. Mention any other details that might be useful.

Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (1 by maintainers)

Most upvoted comments

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.

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 was able to solve this problem with the following configuration:

Upgrade imy 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

....

Changed “typescript”: "^2.0.0"to “typescript”: "2.0.0"in mypackages.json`

Executed the folling commands on my project root

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

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