ng new doesn't work in the latest 1.0.0-rc.1 release
Please provide us with the following information:
OS?
Mac OS X 10.12.4 Beta (16E183b)
Versions.
@angular/cli: 1.0.0-rc.1 node: 6.10.0 os: darwin x64 @angular/cli: error
Repro steps.
- sudo npm i -g @angular/cli@latest
- ng new ng2cli-test --skip-git
The log given by the failure.
The package "angular-cli" has been renamed to "@angular/cli". The old package will be deprecated soon.
Please take the following steps to avoid issues: "npm install --save-dev @angular/cli@latest"
You cannot use the new command inside an Angular CLI project.
Mention any other details that might be useful.
I'm running the new command inside an empty folder, not inside an existing Angular CLI project. Also I don't have the old 'angular-cli' installed on my system.
https://www.npmjs.com/package/@angular/cli shows that the latest release is 1.0.0-rc.1 is the latest of 11 releases . But the latest is 1.0.0-rc.0 per https://github.com/angular/angular-cli/releases
Use "1.0.0-rc.0" instead.
ok, I moved back to rc.0 as suggested and I get this:
ng --help
/usr/local/lib/node_modules/@angular/cli/bin/ng:95
const hasOldDevDep = !!packageJsonProject.devDependencies['angular-cli'];
^
TypeError: Cannot read property 'angular-cli' of undefined
at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/bin/ng:95:60)
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 updated to rc.2, but the error is still there:
ng new someproj
The package "angular-cli" has been renamed to "@angular/cli". The old package will be deprecated soon.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"
You cannot use the new command inside an Angular CLI project.
ng --version output
ng --version
The package "angular-cli" has been renamed to "@angular/cli". The old package will be deprecated soon.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
@angular/cli: 1.0.0-rc.2
node: 6.10.0
os: darwin x64
@angular/cli: error
Try checking the parent directories for node_modules/ or angular-cli.json` and delete it.
This seems related to the following closed issues, if the problem persists I recommend asking in StackOverflow: #1079 #1045 #2174
Per @filipesilva: "Somewhere in the folders above your current one there is either a node_modules/ folder or a angular-cli.json. Basically the command is detecting that you are already a npm project."
That was it :) I had a rebel package.json somewhere in the ancestor folders and that was triggering the error.
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.