Nest-cli: Error: Invalid JSON character: "\t" at 17:3 (@angular-devkit/core)

Created on 5 Dec 2019  路  5Comments  路  Source: nestjs/nest-cli

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior


I try to create a library for our monorepo with the nest CLI but it fails

Expected behavior


It should create a library for the monorepo

Minimal reproduction of the problem with instructions


Private repo unfortunately

What is the motivation / use case for changing the behavior?

Environment

 _   _             _      ___  _____  _____  _     _____
| \ | |           | |    |_  |/  ___|/  __ \| |   |_   _|
|  \| |  ___  ___ | |_     | |\ `--. | /  \/| |     | |
| . ` | / _ \/ __|| __|    | | `--. \| |    | |     | |
| |\  ||  __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/  \____/\_____/\___/


[System Information]
OS Version     : Linux 4.9
NodeJS Version : v13.2.0
NPM Version    : 6.13.1
[Nest Information]
platform-express version : 6.10.5
microservices version    : 6.10.5
common version           : 6.10.5
core version             : 6.10.5

Error

Error: Invalid JSON character: "\t" at 17:3.
    at _readString (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:305:19)
    at _readProperty (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:487:15)
    at _readObject (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:524:30)
    at _readValue (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:674:22)
    at _readProperty (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:491:19)
    at _readObject (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:515:26)
    at _readValue (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:674:22)
    at parseJsonAst (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:721:17)
    at Object.parseJson (/workspaces/****/node_modules/@angular-devkit/core/src/json/parser.js:750:24)
    at updateJsonFile (/workspaces/*****/node_modules/@nestjs/schematics/lib/library/library.factory.js:110:29)

Dependencies

"dependencies": {
        "@nestjs/common": "^6.10.5",
        "@nestjs/core": "^6.10.5",
        "@nestjs/microservices": "^6.10.5",
        "@nestjs/platform-express": "^6.10.5",
        "apify": "^0.17.1-beta.0",
        "cache-manager": "^2.10.1",
        "cache-manager-redis-store": "^1.5.0",
        "class-transformer": "^0.2.3",
        "class-validator": "^0.11.0",
        "compression": "^1.7.4",
        "firebase-admin": "^8.8.0",
        "helmet": "^3.21.2",
        "pretty-error": "^2.2.0-rc.1",
        "puppeteer-core": "^2.0.0",
        "redis": "^2.8.0",
        "reflect-metadata": "^0.1.13",
        "rxjs": "~7.0.0-alpha.0"
    },
    "devDependencies": {
        "@nestjs/cli": "^6.12.9",
        "@nestjs/schematics": "^6.7.0",
        "@nestjs/swagger": "^4.0.4",
        "@nestjs/testing": "^6.7.1",
        "@types/compression": "^1.0.1",
        "@types/dotenv": "^8.2.0",
        "@types/express": "^4.17.2",
        "@types/helmet": "^0.0.45",
        "@types/jest": "24.0.23",
        "@types/node": "^12.12.14",
        "@types/puppeteer-core": "^2.0.0",
        "@types/supertest": "^2.0.8",
        "dotenv": "^8.2.0",
        "firebase-tools": "^7.9.0",
        "git-cz": "^3.3.0",
        "husky": "^3.1.0",
        "jest": "^25.0.0",
        "supertest": "^5.0.0-0",
        "swagger-ui-express": "^4.1.2",
        "ts-jest": "^24.2.0",
        "ts-loader": "^6.2.1",
        "ts-node": "^8.5.4",
        "tsconfig-paths": "^3.9.0",
        "tslint": "^6.0.0-beta1",
        "typescript": "^3.7.3",
        "webpack-merge": "^4.2.2"
    }
needs clarification

Most helpful comment

I was having the same issue and when I checked under the hood, the cli tries to parse tsconfig.json and package.json and my tsconfig.json had an extra comma, rendering it invalid json.

You might wanna check the same @divanvb !

All 5 comments

Please, provide a minimal repository which reproduces your issue.

I was having the same issue and when I checked under the hood, the cli tries to parse tsconfig.json and package.json and my tsconfig.json had an extra comma, rendering it invalid json.

You might wanna check the same @divanvb !

iostreamer-X
thank you

Yes, I can confirm. The extra comma in root tsconfig.json (not added by me, btw) caused this issue in my case.

I was having the same issue and when I checked under the hood, the cli tries to parse tsconfig.json and package.json and my tsconfig.json had an extra comma, rendering it invalid json.

You might wanna check the same @divanvb !

Thanks, You saved my complete day.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shekohex picture shekohex  路  6Comments

METACEO picture METACEO  路  6Comments

iangregsondev picture iangregsondev  路  6Comments

alexbuczynsky picture alexbuczynsky  路  5Comments

bovandersteene picture bovandersteene  路  5Comments