2017-09-06 178 views
0

我正在使用npm(节点packege管理器),与Angular2, 我试图改变服务器的端口,但它 不运行,这是我的bs -config.json:npm如何更改服务器端口

{ 
    "server": { 
    "port": 8080 
    "baseDir": "src", 
    "routes": { 
     "/node_modules": "node_modules" 
    } 
    } 
} 
+0

你也可以尝试不用永久更改而运行像这样'ng serve --port 8080' –

回答

2

因此,有两个错误: - 你应该优先于属性“服务器” 较高声明属性“端口” - 你缺少逗号

尝试这个:

{ 
    // local port 
    "port": 8080, 
    "server": { 
    "baseDir": "src", 
    "routes": { 
     "/node_modules": "node_modules" 
    } 
    } 
} 
相关问题