You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RC.0 on Ubuntu 16.04 any command of ng gives error #5022
Linux hostname 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Versions.
ng -v gives error
/usr/lib/node_modules/@angular/cli/bin/ng:94
const hasOldDep = !!packageJsonProject.dependencies['angular-cli'];
^
TypeError: Cannot read property 'angular-cli' of undefined
at Object. (/usr/lib/node_modules/@angular/cli/bin/ng:94:54)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
I had a similar error on OSX which seemed to stem eventually from not having a devDependencies key in my package.json - I added devDependencies and dependencies as empty objects to my package.json and then ng started working!
Hello I have the same problem but on Windows 10. Completely fresh install of everything from scratch and just trying to use ng help throws the following:
Stack Trace:
const hasOldDevDep = !!packageJsonProject.devDependencies['angular-cli'];
^
TypeError: Cannot read property 'angular-cli' of undefined
at Object.<anonymous> (C:\Users\jwuliger\AppData\Roaming\nvm\v7.6.0\node_modules\@angular\cli\bin\ng:95:60)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:422:7)
at startup (bootstrap_node.js:143:9)
at bootstrap_node.js:537:3
So I am not even dealing with a project yet. What am I missing here? Did something change with how you are supposed to install the CLI in RC0?
What was strange is I had just installed the cli globally using NPM. I wasn't even creating a project yet. I was fiddling with some things and now everything works except trying to run an NG4 version.
Activity
[-]RC.0 on Ubuntu 16.04 any comman of ng gives error[/-][+]RC.0 on Ubuntu 16.04 any command of ng gives error[/+]danimality commentedon Feb 26, 2017
I had a similar error on OSX which seemed to stem eventually from not having a devDependencies key in my package.json - I added devDependencies and dependencies as empty objects to my package.json and then ng started working!
mrudangit commentedon Feb 26, 2017
I can't even create a project to begin with.
even ng -v gives eror
jwuliger commentedon Feb 26, 2017
Hello I have the same problem but on Windows 10. Completely fresh install of everything from scratch and just trying to use
ng helpthrows the following:Stack Trace:
So I am not even dealing with a project yet. What am I missing here? Did something change with how you are supposed to install the CLI in RC0?
Thanks.
altschuler commentedon Feb 26, 2017
@jwuliger Did you remove
angular-clifrom your package.json?jwuliger commentedon Feb 26, 2017
@altschuler Oh yeah, I had that removed already. Everything was working with Beta.32-3. Its odd I am investigating now.
danimality commentedon Feb 26, 2017
what happens if you manually create a package.json with an empty object for the dev dependencies?
jwuliger commentedon Feb 27, 2017
What was strange is I had just installed the cli globally using NPM. I wasn't even creating a project yet. I was fiddling with some things and now everything works except trying to run an NG4 version.
cdarken commentedon Feb 28, 2017
As @mrudangit said, the error appears when trying to run
ng new. It runs inside an older project. But how do we create a new one? :)cdarken commentedon Feb 28, 2017
Found this commit: 211270d
It looks like that might prevent the error.
ronenwo commentedon Mar 2, 2017
created a package.json as @danimality suggested and it worked for me
filipesilva commentedon Mar 14, 2017
Closing as it seems to be sorted.
angular-automatic-lock-bot commentedon Sep 6, 2019
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.