-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
area: @angular-devkit/corefreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is neededseverity1: confusingtype: bug/fix
Milestone
Description
Bug Report or Feature Request (mark with an x
)
- [x] bug report
- [ ] feature request
Area
- [x] devkit
- [ ] schematics
Versions
node --version
v10.3.0
npm --version
6.1.0
sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.6
BuildVersion: 16G1314
Repro steps
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli
ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.0.8
Node: 10.3.0
OS: darwin x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.0
typescript 2.7.2
ng new foo ✘ 141
The log given by the failure
Unexpected end of file.
Error: Unexpected end of file.
at _readValue (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:533:19)
at parseJsonAst (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:605:17)
at Object.parseJson (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js:631:12)
at getLegacyPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/config.js:179:35)
at Object.getPackageManager (/usr/local/lib/node_modules/@angular/cli/utilities/config.js:120:38)
at NewCommand.runSchematic (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:74:38)
at NewCommand.<anonymous> (/usr/local/lib/node_modules/@angular/cli/commands/new.js:77:25)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/@angular/cli/commands/new.js:7:71
at new Promise (<anonymous>)
Desired functionality
Properly recovered from or better error message caused by bad data in user files.
The cause was that ~/.angular-cli.json
was an empty file.
Mention any other details that might be useful
I track down the error using
node --inspect --debug-brk /usr/local/bin/ng new foo
with a break-point in /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/json/parser.js
just before UnexpectedEndOfInputException
call super("Unexpected end of file.")
then I realize that this file const legacyGlobalConfigPath = path.join(homeDir, '.angular-cli.json')
was used and when I take a look it was empty, so the error is consistent with a bad json parsing, but at least will be good if we had the filename in the error
xmlking, Cito, Sharpsturdy, akhilravipati97, HakamFostok and 2 moreFeujo
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/corefreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is neededseverity1: confusingtype: bug/fix