Skip to content

Unexpected token / in JSON at position 762 #11103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
devcer opened this issue Jun 4, 2018 · 6 comments
Closed

Unexpected token / in JSON at position 762 #11103

devcer opened this issue Jun 4, 2018 · 6 comments

Comments

@devcer
Copy link

devcer commented Jun 4, 2018

Versions


Angular CLI: 6.0.7
Node: 8.9.4
OS: linux x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.7
@angular-devkit/build-angular     0.6.7
@angular-devkit/build-optimizer   0.6.7
@angular-devkit/core              0.6.7
@angular-devkit/schematics        0.6.7
@angular/cli                      6.0.7
@ngtools/webpack                  6.0.7
@schematics/angular               0.6.7
@schematics/update                0.6.7
rxjs                              5.5.11
typescript                        2.5.3
webpack                           4.8.3

Repro steps

  • Step 1 give command ng g service data to generate a service

Observed behavior

Unexpected token / in JSON at position 762

Desired behavior

A new service should be created in the designated folder

Mention any other details that might be useful (optional)

Was working fine with before angular cli 1.7.x. Updated my cli and I'm completely struck now. couldnt even find any articles to go back from 6.x to 1.7.x

@ashgibson
Copy link

See #10880. Your angular.json is probably not valid json.

@devcer
Copy link
Author

devcer commented Jun 6, 2018

my angular.json looks fine. just linted with jsonlint.
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "pwc": { "root": "", "sourceRoot": "src", "projectType": "application", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "tsConfig": "src/tsconfig.app.json", "polyfills": "src/polyfills.ts", "assets": [ "src/assets", "src/favicon.ico" ], "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ], "scripts": [ "src/assets/js/appkit.min.js", "src/assets/js/vendor.min.js", "src/assets/js/appmain.js" ] }, "configurations": { "production": { "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "pwc:build" }, "configurations": { "production": { "browserTarget": "pwc:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "pwc:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "karmaConfig": "./karma.conf.js", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "scripts": [ "src/assets/js/appkit.min.js", "src/assets/js/vendor.min.js", "src/assets/js/appmain.js" ], "styles": [ "src/styles.css" ], "assets": [ "src/assets", "src/favicon.ico" ] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json" ], "exclude": [ "**/node_modules/**" ] } } } }, "pwc-e2e": { "root": "", "sourceRoot": "", "projectType": "application", "architect": { "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "./protractor.conf.js", "devServerTarget": "pwc:serve" } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "e2e/tsconfig.e2e.json" ], "exclude": [ "**/node_modules/**" ] } } } } }, "defaultProject": "pwc", "schematics": { "@schematics/angular:component": { "prefix": "app", "styleext": "css" }, "@schematics/angular:directive": { "prefix": "app" } } }

@devcer
Copy link
Author

devcer commented Jun 6, 2018

I'm not sure what happened but an npm update fixed it! I was able to generate my pipe with cli.

@filipesilva
Copy link
Contributor

I'm not too sure what happened here either, but happy to hear it's not a problem anymore.

@m4r71n85
Copy link

delete package-lock.json

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants