Closed senglory closed 7 years ago
Same issue was discussed here: https://github.com/angular/angular-cli/issues/4736
I'm also struggling to make it work..
Same issue when I try to 'ng build' this Visual Studio Template.
You can't do this stuff here. The quickstart is a systemjs project. You can't convert it to CLI just by installing two packages.
Same of my how to resolve this issue?
I got the similar issue , but resolved it by adding .angular-cli.json file at root level (As I creted a diffrent repo by just copying the existing angular project) .it was missing in my case and I didnt created project using cli
I got similar issue and resolved it by adding .angular-cli.json file.
@ppgowda4 I got the same issue and I didn't solve it. Can you tell me where did you create that json file? I mean what's the exact path of it? And what's the content of it?
Same problem.
Solution copy .angular-cli.json from you angular folder
and change root path to be adequate.
Why are you people trying to do "ng build" here? This is not a cli project nor is meant to be
Well in my case i was Trying to do a ng serve
nor ng serve. This is a completely different thing
I get the same error while running "ng serve" where to copy .angular-cli.json file?
Don't do it.
What can be the possible solution?
to what problem?
when i enter 'ng serve'
Cannot read property 'config' of null TypeError: Cannot read property 'config' of null at Class.run (C:\Users\Shubham Kamath\Desktop\Projects\web-chat\node_modules\@angular\cli\tasks\serve.js:23:63) at check_port_1.checkPort.then.port (C:\Users\Shubham Kamath\Desktop\Projects\web-chat\node_modules\@angular\cli\com mands\serve.js:114:26) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
And why are you running ng serve
?
"Ng serve" is to start the agunlar application. I dont understand your question Foxandxss. Thats when people are experiencing issues.
So if you dont use ng serve what do you use?
No, ng serve
is a command that the Angular CLI applications have. This is not an Angular CLI application so that command doesn't exist.
It is like trying to use a plane like if it were a car. They both travels, but they are different things.
This starter has a npm start
for starting a server.
I'm learning Angular and was going through a tutorial. This is Angular-Firebase application. I figured out that .angular-cli.json file was moved. Now pasted it back and it's working. Thanks!
I feel like I am invisible. Don't use this project like a CLI application, I created this repo, I know what I am talking about.
It is up to you.
What is that tutorial @shubhaem ?
Thanks Sir Foxandxss for npm start
@Foxandxss omg ty... yesterday was everything fine, but today i totally forgot, that I started the Project with "npm start" and tried "ng serve"... shame on me
@Foxandxss i understand what you mean, so what we do to deploy application?
you need .angular-cli.json to run "ng serve""
like this, save as .angular-cli.json
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "name": "win" }, "apps": [ { "root": "src", "outDir": "dist", "assets": [ "assets", "favicon.ico" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ "styles.scss" ], "scripts": [], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } } ], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "project": "src/tsconfig.app.json" }, { "project": "src/tsconfig.spec.json" }, { "project": "e2e/tsconfig.e2e.json" } ], "test": { "karma": { "config": "./karma.conf.js" } }, "defaults": { "styleExt": "scss", "component": {} } }
@marslan2037 This project is not optimized for deployments, it says so in the readme. It is a demo project for the docs, not to create your own applications.
@adamnurdin01 I said it already, but don't do that.
After trying ng serve I am getting bellow error message
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, which will only support Node 6.9 and greater. This package will be officially deprecated shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
Parsing angular-cli.json failed. Please make sure your angular-cli.json is valid JSON. Error: SyntaxError: Unexpected token in JSON at position 0 npm ERR! Test failed. See above for more details.
npm start doesnt solve the problem.. can anyone help with this?
Fixed this issue in my case...If you are moving your project through zip file then 1.move the zip file to the wanted folder 2. unzip the project 3.run npm install 4. run npm start .. hope this helps
OK, since I found this page, like apparently many others looking for "ng serve/build" with null config error, I will add my 2 cents here too so it will be seen... When I saw the bit about the .angular-cli.json file being missing, I realized My problem was I had (unusual for me) copied the listed contents of one project folder into another via the Mac OSX Finder, WHICH DOESN'T SHOW THE ".whatever" (i.e. hidden) FILES!! (arrg). (Normally, I do that sort of thing via Eclipse which does show those files.)
I had the same problem and red some suggestions here. So, I just generated a new temporary app with help of CLI and copied .angular-cli.json
to the current project and it started to work!
ng new my-temporary-app
cp my-temporary-app/.angular-cli.json ./
ng serve --open
Mine is an npm project, I am trying to do an AOT compilation of my project since that facility is not available in npm, am converting it to an 'angular.cli' based,
thank Foxandxss sir npm start is working
final complated
Its because it's searching for the angular-cli.json and it can't find it. adding it back should work.
In project folder, renaming the file _angular-cli.json to .angular-cli.json solved this issue.
I got the similar issue , but resolved it by adding .angular-cli.json file at root level (As I creted a diffrent repo by just copying the existing angular project) .it was missing in my case and I didnt created project using cli
The solution for me was this one. If you are creating the image with Docker, make sure .angular-cli.json is not in your .dockerignore file
I pulled the latest version of the project and issued the following commands:
Then I tried to run "ng build --verbose" and got the following weird error:
Cannot read property 'config' of null TypeError: Cannot read property 'config' of null at Class.run (C:\tmp\ang\quickstart\node_modules\@angular\cli\tasks\build.js:15:56) at Class.run (C:\tmp\ang\quickstart\node_modules\@angular\cli\commands\build.js:149:26) at Class.Command.validateAndRun (C:\tmp\ang\quickstart\node_modules\@angular\cli\ember-cli\lib\models\command.js:128:15) at C:\tmp\ang\quickstart\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:92:22 at tryCatch (C:\tmp\ang\quickstart\node_modules\rsvp\dist\rsvp.js:539:12) at invokeCallback (C:\tmp\ang\quickstart\node_modules\rsvp\dist\rsvp.js:554:13) at C:\tmp\ang\quickstart\node_modules\rsvp\dist\rsvp.js:629:16 at flush (C:\tmp\ang\quickstart\node_modules\rsvp\dist\rsvp.js:2414:5) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9)
What I'm doing wrong?