Error at NPM start

I get error at npm start with the template ACE repo. My npm is 6.14.11 and

npm start

> my-app@0.0.1 start C:\Users\appp\Downloads\atlassian-connect-express-template
> node -r esm app.js

morgan deprecated default format: use combined format node_modules\esm\esm.js:1:278827
SyntaxError: JSON5: invalid character '​' at 46:1
const util = require('./util')

    at syntaxError (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:1083:17)
    at invalidChar (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:1028:12)
    at Object.beforePropertyName (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:632:15)
    at Object.default (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:146:37)
    at lex (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:78:42)
    at Object.parse (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\json5\lib\parse.js:25:17)
    at Object.loadConfig [as loadJSON] (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\atlassian-connect-express\lib\internal\utils.js:41:23)
    at new Addon (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\atlassian-connect-express\lib\index.js:33:30)
    at module.exports (C:\Users\appp\Downloads\atlassian-connect-express-template\node_modules\atlassian-connect-express\lib\index.js:231:10)
    at Object.<anonymous> (C:\Users\appp\Downloads\atlassian-connect-express-template\app.js:35:15)
    at Generator.next (<anonymous>) {
  lineNumber: 46,
  columnNumber: 1
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app@0.0.1 start: `node -r esm app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\appp\AppData\Roaming\npm-cache\_logs\2021-02-18T17_36_05_936Z-debug.log

my package json file:

“dependencies”: {

"@atlaskit/button": "^15.1.0",

"@atlaskit/section-message": "^5.0.7",

"atlassian-connect-express": "^6.5.0",

"body-parser": "^1.19.0",

"compression": "^1.7.4",

"cookie-parser": "^1.4.5",

"pg": "^8.5.1",

"errorhandler": "^1.5.1",

"esm": "^3.2.25",

"express": "^4.17.1",

"express-hbs": "^2.3.4",

"helmet": "^4.1.1",

"morgan": "^1.10.0",

"nocache": "^2.1.0",

"react": "^16.13.1",

"react-dom": "^16.13.1",

"sequelize": "^6.5.0",

"styled-components": "^5.2.0"

},

“devDependencies”: {

"@babel/core": "^7.11.6",

"babel-plugin-styled-components": "^1.11.1",

"concurrently": "^5.3.0",

"eslint": "^7.10.0",

"eslint-plugin-react": "^7.21.3",

"longjohn": "^0.2.12",

"ngrok": "^3.3.0",

"nodemon": "^2.0.4",

"parcel-bundler": "^1.12.4",

"parcel-plugin-externals": "^0.5.1",

"sqlite3": "^5.0.0"

}

Looking at the stack trace, it seems that what it is trying to do is parse the file C:\Users\appp\Downloads\atlassian-connect-express-template\config.json. It seems to encounter an error at line 46.

Now the error message that you pasted looked pretty weird at first, because what is invalid character '​' supposed to be, until I noticed that there is a unicode character U+200B (zero-width space) between those quotes.

Now I’m not sure how the character got there, I cannot see it in the original config.json. Maybe you copy-pasted something from a website where the code was formatted somehow?

So maybe have a look at config.json at line 46. When navigating each character on the line using the arrow keys, you should be able to notice a zero-width space by the fact that you have to press the arrow key twice to get to the next character.

1 Like

Wow that worked. Indeed I had it copy-past. Though I did not know that it was parsing config.json file because it is not specified in logs.

My config just had a empty line at line 46. I deleted it and it worked. This was my config at line 46.