Monday, 10 April 2017

Angular CLI error due to config null?

I follow this steps in order to create a heroku app to put inside my angular2-nodejs-express-mongodb application:

  1. heroku login
  2. cd my-project-app folder
  3. git init
  4. heroku git:remote -a my-app-name (That I previously created o heroku)
  5. Download my repo from github and copy all files into my-project-app folder
  6. Then I edit in db.ts the url of MongoDB server to a real server. (I create a MongoDB server with mLab)
  7. npm i ng build -prod

And then when I arrive to the step 7 of the list I have a problem when I try to install modules in an Angular 2, the error is here:

Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
    at Class.run (/Users/xxx/Documents/workspace/full/node_modules/@angular/cli/tasks/build.js:16:56)
    at Class.run (/Users/xxx/Documents/workspace/full/node_modules/@angular/cli/commands/build.js:143:26)
    at Class.<anonymous> (/Users/xxx/Documents/workspace/full/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)

and here you can see the versions of node & angular CLI:

@angular/cli: 1.0.0
node: 6.10.0
os: darwin x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1

I read some posts but I didn't know how to solve it.


And I have another error to, when I try to connect to my db:

MongoDB shell version v3.4.2
connecting to: mongodb://ds021731.mlab.com:21731/users
MongoDB server version: 3.2.11
WARNING: shell and server versions do not match



via AAg

No comments:

Post a Comment