Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start encounters with "Cannot read property 'config' of null" #2

Closed
sr-hosseyni opened this issue Apr 14, 2017 · 6 comments
Closed

Comments

@sr-hosseyni
Copy link

sr-hosseyni commented Apr 14, 2017

After cloning project and running npm install, when I was trying to launch development server
got

Cannot read property 'config' of null

error !

complete output of npm start :
`> ngx-starter-kit@1.0.0 start /Users/sr_hosseini/Projects/Angular4
> ng serve --proxy-config proxy.conf.js

Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (/Users/sr_hosseini/Projects/Angular4/node_modules/@angular/cli/tasks/serve.js:22:63)
at check_port_1.checkPort.then.port (/Users/sr_hosseini/Projects/Angular4/node_modules/@angular/cli/commands/serve.js:103:26)
at process._tickCallback (internal/process/next_tick.js:109:7)

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/5.3.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngx-starter-kit@1.0.0 start: ng serve --proxy-config proxy.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngx-starter-kit@1.0.0 start script 'ng serve --proxy-config proxy.conf.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ngx-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng serve --proxy-config proxy.conf.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ngx-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ngx-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/sr_hosseini/.npm/_logs/2017-04-14T16_36_41_828Z-debug.log`

debug.log content :
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/5.3.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start' ]

2 info using npm@4.2.0
3 info using node@v7.8.0

4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ng
Uploading 2017-04-14T16_36_41_828Z-debug.log…
x-starter-kit@1.0.0prestart: ngx-starter-kit@1.0.0
6 silly lifecycle ngx-starter-kit@1.0.0
prestart: no script for prestart, continuing
7 info lifecycle ngx-starter-kit@1.0.0start: ngx-starter-kit@1.0.0
8 verbose lifecycle ngx-starter-kit@1.0.0
start: unsafe-perm in lifecycle true
9 verbose lifecycle ngx-starter-kit@1.0.0start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/sr_hosseini/Projects/Angular4/node_modules/.bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/sr_hosseini/Projects/phalcon-test/vendor/phalcon/devtools:/.composer/vendor/bin
10 verbose lifecycle ngx-starter-kit@1.0.0start: CWD: /Users/sr_hosseini/Projects/Angular4
11 silly lifecycle ngx-starter-kit@1.0.0
start: Args: [ '-c', 'ng serve --proxy-config proxy.conf.js' ]
12 silly lifecycle ngx-starter-kit@1.0.0start: Returned: code: 1 signal: null
13 info lifecycle ngx-starter-kit@1.0.0
start: Failed to exec start script
14 verbose stack Error: ngx-starter-kit@1.0.0 start: ng serve --proxy-config proxy.conf.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid ngx-starter-kit@1.0.0
16 verbose cwd /Users/sr_hosseini/Projects/Angular4
17 error Darwin 15.6.0
18 error argv "/usr/local/Cellar/node/5.3.0/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.8.0
20 error npm v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error ngx-starter-kit@1.0.0 start: ng serve --proxy-config proxy.conf.js
23 error Exit status 1
24 error Failed at the ngx-starter-kit@1.0.0 start script 'ng serve --proxy-config proxy.conf.js'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the ngx-starter-kit package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error ng serve --proxy-config proxy.conf.js
24 error You can get information on how to open an issue for this project with:
24 error npm bugs ngx-starter-kit
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls ngx-starter-kit
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

@sinedied
Copy link
Member

I cannot reproduce the issue, I tried with node 6.9.5/npm 3.10.0, node 7.8.0/npm 4.2.0 and node 7.9.0/npm 4.2.0. I'm on latest OSX version.

Did you install a RC/beta version of angular-cli? According to this post: angular/angular-cli#4736
the issue is related to either a missing .angular-cli.json or outdated npm package that may come from the cache.

Could you try this and see if it resolves the issue?

npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
rm -rf node_modules
npm install

@sr-hosseyni
Copy link
Author

Already I had done this, Anyway redo and nothing changed !

@sinedied
Copy link
Member

Are you sure there is an .angular-cli.json in the folder? Did you move the files after cloning?

The debug log you provided shows something strange, it says node v7.8.0 but from the bin path the node version seems to be 5.3.0: /usr/local/Cellar/node/5.3.0/bin/node`

What does it says when you type which node?

@sr-hosseyni
Copy link
Author

Sorry it was my bad. I had moved files after clone but forgot to move hidden files !
Thank u so much
Your answer

Did you move the files after cloning ?

was great

@xlabpoh
Copy link

xlabpoh commented Nov 4, 2017

How to move the hidden files? Example?

@sinedied
Copy link
Member

sinedied commented Nov 6, 2017

@xlabpoh Move the parent folder instead, or use mv source/.* dest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants