ng --version giving errorI ran the commands:
sudo npm uninstall -g angular-cli
npm cache clean
sudo npm install -g angular-cli@webpack
After it ran the install process, now when i run any of the "NG" commands such as:
ng --version
I get the following errors:
Error while running script "/usr/local/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 (/usr/local/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> (/usr/local/lib/node_modules/angular-cli/addon/ng2/models/config.ts:7:16)
at Module._compile (module.js:409:26)
at Object.require.extensions..ts (/usr/local/lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14)
Error while running script "/usr/local/lib/node_modules/angular-cli/addon/ng2/models/config.ts":
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.require.extensions..ts (/usr/local/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> (/usr/local/lib/node_modules/angular-cli/addon/ng2/models/config.ts:7:16)
at Module._compile (module.js:409:26)
at Object.require.extensions..ts (/usr/local/lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14)
/usr/local/lib/node_modules/angular-cli/addon/ng2/models/config/config.ts:23
this._config = new (schema_class_factory_1.SchemaClassFactory(schema))(configJson, ...fallbacks);
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.require.extensions..ts (/usr/local/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> (/usr/local/lib/node_modules/angular-cli/addon/ng2/models/config.ts:7:16)
at Module._compile (module.js:409:26)
at Object.require.extensions..ts (/usr/local/lib/node_modules/angular-cli/lib/bootstrap-local.js:30:14)
Did i miss some packages or something?
Unfortunately it seems like our strategy to build TypeScript on the fly does not support Node 4 (needs some ES6 features).
The proper solution will be to build TypeScript offline and publish that, which is coming soon. You'll have to be patient until then. I'll tag the PR with fixing this issue.
Now working on node 6.5
Just had to install again.
please update readme in order a lot of people use last node and npm version ,
actually on the home page shows:
The generated project has dependencies that require Node 4.x.x and NPM 3.x.x.
I just installed:
On my MAC (OS El Capitan)
Then i did ng new test-project
After downloading all the dependencies etc, when i do ng serve
I get dozens of errors 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'.
ERROR in [default]
Cannot find global type 'IArguments'.
ERROR in [default]
Cannot find global type 'Number'.
ERROR in [default]
Cannot find global type 'Object'.
ERROR in [default]
Cannot find global type 'RegExp'.
ERROR in [default]
Cannot find global type 'String'.
Then i tried updating to RC6 - still the same issue
Is it a broken build ?
I have the same Error Does any one know how to solve that .
try to remove the "^" before the typescript version in your package.json.
should be "typescript": "2.0.0".
The current latest beta.14 should have fixed all these issues. Please follow the upgrade instructions in https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12.
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._
Most helpful comment
Now working on node 6.5
Just had to install again.