You cannot use the new command inside an angular-cli project.
Installed latest version of angular-cli on my windows pc trying just to create new project with:
ng new project_name
getting error: You cannot use the new command inside an angular-cli project.
Tried to remove , reinstall with npm cache clean, nothing helps :(
OS?
Windows 10 x64.
Versions.
angular-cli: 1.0.0-beta.17 node: 6.4.0 os: win32 x64
Repro steps.
ng new project_name
The log given by the failure.
Normally this include a stack trace and some more information.
After deleting package.json file at user folder, it worked. (Windows 10)
I had the similar problem and nothing was working out but then when I ran cmd as administrator it worked for me. First run the Command Prompt as administrator ans then create the new project and if it still doesn't create the project run the code rm -r -f // and then run ng new and then run ng serve and it should work (use this method only if the 1st part doesn't work). If nothing works just uninstall node and every other file related to it th and run the previous code again it will work. Also open the editor as an administrator to edit your code otherwise you might run into permission issues.
I'm using MacOS and I had this problem today... The way I fixed it was:
1 - I had no idea why, but there was a node_modules and a package.json on my home folder... I removed them; 2 - I also removed a node_modules and package.json from my current project folder 3 - Then, ng new project-name worked :)
I hope it helps somebody else...
p.s.: Please, angular@cli people, take a look at this weird thing going on... I don't know why angular@cli is creating such files in the home o.O
I had the same problem, i deleted the package.json file from the folder, after that it works :)
I had the same problem, i deleted the package.json file from the folder, after that it works :) me too! working now!!!!!!!!!!
actually, you don't need to delete the whole package.json file, just if you can delete angular cli in devdependendy line, it will work but don't forget to save the json file in your editor, then restart your terminal. that how it worked for me
try first : you just need to remove "@angular/cli": "1.6.1", "@angular/compiler-cli": "^5.2.9",
from package.json
or _**
Search on the root folder for a file called package.json then delete it .
It will solve the problem.
**_
I had the same problem. It works fine now after deleting package.json thanks a lot you guys. May I know the actual use of that file? How the existence of it cause this problem... I have some other file "package-lock.json" which bothers me than this. ;)
Hi All, I have faced this issue but got this solution
- Create a dir test
- Cd test
- run npm init command
- ng new Ang5App
- Finally, it works for me
thanks a lot ,it works for me .Allah bless you
I haven't any package.json file in my root directory or node_modules or angular.json and I still can't run ng new something inside of a CLI project and the new project has to be inside of this CLI project. So what I have to do?
excecute npm install --save-dev @angular/cli@latest into dir work.. (example: Desktop)
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.