Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OSX El CapitanVersions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.16
node: 4.6.0
os: darwin x64
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
A lot of changes but the backend guy can work with cli and use ng serveThe log given by the failure.
Normally this include a stack trace and some more information.
ng serve
Provided host localhost could NOT be bound. Please provide a different host address or hostname
Error: Provided host localhost could NOT be bound. Please provide a different host address or hostname
at Error (native)
at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:139:27
at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:52:16
at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:264:21
at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:117:16
at Server.onError (/usr/local/lib/node_modules/angular-cli/node_modules/portfinder/lib/portfinder.js:54:14)
at Server.g (events.js:260:16)
at emitOne (events.js:77:13)
at Server.emit (events.js:169:7)
at emitErrorNT (net.js:1269:8)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
Thanks for your help
It seems like there is some problem binding to localhost. Can you try ng serve --host 0.0.0.0 instead?
surfer-172-29-10-205-server:frontend philipplubeck$ ng serve --host 0.0.0.0
* NG Live Development Server is running on http://0.0.0.0:4200. *
4489ms building modules 4ms add1ms 92% chunk asset optimization/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:704
throw new Error('"' + aSource + '" is not in the SourceMap.');
^
Error: "/usr/local/lib/node_modules/angular-cli/node_modules/angular2-template-loader/index.js!/Users/philipplubeck/frontend/src/app/gearslist.service.ts" is not in the SourceMap.
at SourceMapConsumer_sourceContentFor as sourceContentFor
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/node_modules/source-map/lib/source-node.js:133:40
at Array.forEach (native)
at Function.SourceNode_fromStringWithSourceMap as fromStringWithSourceMap
at SourceMapSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/SourceMapSource.js:42:20)
at ReplaceSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ReplaceSource.js:66:29)
at CachedSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/CachedSource.js:12:23)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:40:49
at Array.map (native)
at ConcatSource.node (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/ConcatSource.js:39:60)
at ConcatSource.proto.sourceAndMap (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/SourceAndMapMixin.js:28:18)
at CachedSource.sourceAndMap (/usr/local/lib/node_modules/angular-cli/node_modules/webpack-sources/lib/CachedSource.js:51:28)
at Compilation.
at Array.map (native)
at Compilation.
at Array.forEach (native)
at Compilation.
at Compilation.applyPlugins (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:25:14)
at Compilation.
at next (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:81:11)
at Compilation.
at Compilation.applyPluginsAsync (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:85:13)
at Compilation.
at next (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:81:11)
at Compilation.
at Compilation.applyPluginsAsync (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:85:13)
at Compilation.
at next (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:81:11)
at Compilation.
at Compilation.applyPluginsAsync (/usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:85:13)
at Compilation.seal (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:551:7)
at Compiler.
at /usr/local/lib/node_modules/angular-cli/node_modules/tapable/lib/Tapable.js:152:11
at Compilation.
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:420:12
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at done (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:246:17)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:332:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:52:16
at Object.async.forEachOf.async.eachOf (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:236:30)
at Object.async.forEach.async.each (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/node_modules/async/lib/async.js:209:22)
at Compilation.addModuleDependencies (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:192:8)
at Compilation.processModuleDependencies (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:177:7)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:314:12
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:124:4
at Array.forEach (native)
at callback (/usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:123:12)
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:147:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/NormalModule.js:203:10
at /usr/local/lib/node_modules/angular-cli/node_modules/webpack/lib/NormalModule.js:158:10
at /usr/local/lib/node_modules/angular-cli/node_modules/loader-runner/lib/LoaderRunner.js:365:3
at iterateNormalLoaders (/usr/local/lib/node_modules/angular-cli/node_modules/loader-runner/lib/LoaderRunner.js:206:10)
at /usr/local/lib/node_modules/angular-cli/node_modules/loader-runner/lib/LoaderRunner.js:197:4
at Storage.finished (/usr/local/lib/node_modules/angular-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:39:16)
at /usr/local/lib/node_modules/angular-cli/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose as oncomplete
It looks like using 0.0.0.0 solved your original issue. The followup is a dupe of https://github.com/angular/angular-cli/issues/1982.
getting an 403 Forbidden: incorrect proxy service was requested error, while loading the page on the server : "http://0.0.0.0:4200". Any help please.
Fix (incase, if anyone got stumbled like me) : use your ip instead of "0.0.0.0" while loading the page ie "your ip":4200.
localhost:4200 was working before. Is there a way to get that working again rather than do the lengthy 0.0.0.0 hack?
If someone still phasing this(mac os), you need to edit /etc/hosts and make sure you have this line:
127.0.0.1 localhost
ng serve --host 0.0.0.0
This happens when you change custom hostname
I faced the same issue. I tried everything but nothing workout. Even I created a fresh project, but ng-serve failed. Then you know what I did, hope it may work for you.
in Host file: added this line: your machine IP with localhost e.g
10.XXX.XX.XXX localhost
I have same issue... blue in the face nothing works and the /etc/hosts file is being hacked up
this is terrible they should review what they implemented so folks can serve up their apps from local office on SSL on a domain name with valid certificates all of which i have and still cannot run any ng serve --host
I have a node.js koa ssl server running fineon monogd with the domain name I purchased from rapidSSL and my host name serves up rest friendly JSON like butter off of the node.s koa server beautifully
Building and running the angular app with SSL certificates runs ok but I cannot go prod with LOCALHOST the url keeps saying connection is NOT private
So I need this --host option to work
and it wont
I can run xampp and that will intercept any hits to my domain name on port 80 over SSL at which point I proxy into my node.js but I cannot get this beyond localhost
Provided host mydomainname.com could NOT be bound. Please provide a different host address or hostname
Error: Provided host mydomainname.com could NOT be bound. Please provide a different host address or hostname
cli folks need to allocate a senior developer(s) to iron out this feature its preventing production in the field
ng serve --proxy-config proxy.conf.json --ssl true --ssl-cert "C:/xampp/apache/conf/certs/my.crt" --ssl-key "C:/xampp/apache/conf/cert
s/my.key" --open=true --host my.com --port=4200 --prod=false
???
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._
Most helpful comment
It seems like there is some problem binding to localhost. Can you try
ng serve --host 0.0.0.0instead?