user2995358 user2995358 - 4 years ago 219
AngularJS Question

SyntaxError: Unexpected token :

I am following Angular 2 quickstart here

I am getting following error on npm start:

angular-quickstart/bs-config.js:2
"server": {
^
SyntaxError: Unexpected token :
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)


Here is my bs-config.json

{
"server": {
"baseDir": "src",
"routes": {
"/node_modules": "node_modules"
}
}
}


And here is my package.json:

{
"name": "angular-quickstart",
"version": "1.0.0",
"scripts": {
"start": "npm run lite",
"lite": "lite-server"
},
"license": "MIT",
"dependencies": {
"@angular/common": "~2.4.0",
"@angular/compiler": "~2.4.0",
"@angular/core": "~2.4.0",
"@angular/forms": "~2.4.0",
"@angular/http": "~2.4.0",
"@angular/platform-browser": "~2.4.0",
"@angular/platform-browser-dynamic": "~2.4.0",
"@angular/router": "~3.4.0",
"@angular/upgrade": "~2.4.0",
"angular-in-memory-web-api": "~0.2.4",
"core-js": "^2.4.1",
"rxjs": "5.0.1",
"zone.js": "^0.7.4"
},
"devDependencies": {
"concurrently": "^3.0.0",
"lite-server": "^2.2.2"
}
}


I've latest node:

node -v
v7.5.0


And I've latest nam:

npm -v
4.1.2


Here is my directory structure:
ls
bs-config.js node_modules npm-debug.log package.json src

lin lin
Answer Source

bs-config.js should be an JSON bs-config.json object.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download