angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

NG command does not work. Error while running script.... SyntaxError: Unexpected token.

Open S-Foxx opened this issue 9 years ago • 2 comments

Please provide us with the following information:

OS?

Windows 7

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

Node Version: 7.5.0 NPM Version: 4.2.0

See the log below.

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc. npm install -g @angular/cli@latest Type ng [anything] in the command prompt Error is then displayed

The log given by the failure.

Normally this include a stack trace and some more information.

C:\Projects\FirstProject>ng --version Error while running script "C:\Projects\angular-cli\packages@angular\cli\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 (C:\Projects\angular-cli\lib\bootstrap-loca l.js:33:14) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module._load.parent [as _load] (C:\Projects\angular-cli\lib\boot strap-local.js:69:24) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (C:\Projects\angular-cli\packages@angular\cli\models
config.ts:2:18) at Module._compile (module.js:409:26) Error while running script "C:\Projects\angular-cli\packages@angular\cli\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 (C:\Projects\angular-cli\lib\bootstrap-loca l.js:33:14) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module._load.parent [as _load] (C:\Projects\angular-cli\lib\boot strap-local.js:69:24) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (C:\Projects\angular-cli\packages@angular\cli\models
config.ts:2:18) at Module._compile (module.js:409:26) C:\Projects\angular-cli\packages@angular\cli\models\config\config.ts:15 constructor(_configPath, 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 (C:\Projects\angular-cli\lib\bootstrap-loca l.js:33:14) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module._load.parent [as _load] (C:\Projects\angular-cli\lib\boot strap-local.js:69:24) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (C:\Projects\angular-cli\packages@angular\cli\models
config.ts:2:18) at Module._compile (module.js:409:26)

Mention any other details that might be useful.

I've tried cloning the angular CLI repository. I've tried installing it via the npm install -g @angular/cli@latest command. I've made sure the path variables are correct in the 'Environment Variables' of my computer. I've tried uninstalling it, cleaning the npm cache, and then reinstalling the angular CLI, all with no luck. I was able to get this to work on my windows 10 PC but not my windows 7 PC.


Thanks! We'll be in touch soon.

S-Foxx avatar Feb 15 '17 16:02 S-Foxx

Closing this because I was able to install the angular-cli with yarn as a work aroudn the steps I took are:

Install yarn: npm install yarn -g use yarn to install angular-cli: yarn global add angular-cli.

S-Foxx avatar Feb 15 '17 16:02 S-Foxx

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.