CLI error when found 'package.json' has no 'devDependencies' entry
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OS X El Capitan
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
1.0.0-rc.0
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Run any cli command in a directory that contains a package.json or a subdirectory whose parent contains a package.json.
The log given by the failure.
Normally this include a stack trace and some more information.
/Users/Greg/.nvm/versions/node/v6.10.0/lib/node_modules/@angular/cli/bin/ng:95 const hasOldDevDep = !!packageJsonProject.devDependencies['angular-cli']; ^
TypeError: Cannot read property 'angular-cli' of undefined
at Object.
Mention any other details that might be useful.
The package.json file in question was in my HOME folder (I think Yarn put it there- #4762 pointed me in the right direction) and it only had a dependencies section. Once I added a devDependencies section the CLI worked properly.
Thanks! We'll be in touch soon.
@hansl I can see this issue has been closed. But is the code released ? I am trying to install it but still the same error.
sudo npm install -g @angular/cli@latest
@anantgoldie Released with RC.1 https://github.com/angular/angular-cli/blob/master/CHANGELOG.md#100-rc1-2017-03-03
Why is it showing a warning even though I have CLI installed globally.
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues: "npm install --save-dev @angular/cli@latest"
@angular/cli: 1.1.3 node: 7.2.1 os: win32 x64
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.