Angular/cli not installed properly
Angular/cli not installed properly
When I install angular/cli I get the following:
$ npm install @angular/cli
npm WARN saveError ENOENT: no such file or directory, open
'sandbox2package.json'
npm WARN enoent ENOENT: no such file or directory, open
'sandbox2package.json'
npm WARN sandbox2 No description
npm WARN sandbox2 No repository field.
npm WARN sandbox2 No README data
npm WARN sandbox2 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3
(node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"})
This is a continuation of the insallation above. I am forced to add more comments here;
+ @angular/cli@6.1.0
updated 1 package in 54.164s
[!] 4 vulnerabilities found [22842 packages audited]
Severity: 1 Low | 3 Moderate
Run `npm audit` for more detail
Then creating a project fails:
$ ng new hd12
newTree.optimize is not a function
And Then, ng new hd12
– A.Sakkeer
1 hour ago
I'm not sure it will solve issue, but @angular/cli should be installed globally
npm install -g @angular/cli. Could you try this from an other directory ?– Thierry Falvo
1 hour ago
npm install -g @angular/cli
@ A. SakkeerI still get the error: $ ng new hd12 newTree.optimize is not a function
– koque
1 hour ago
1 Answer
1
Problem is with the latest version of angular/cli.
$ npm install @angular/cli@latest
The last known working version works:
npm install --save-dev @angular/cli@6.1.0-rc.0
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Try this, npm install -g @angular/cli
– A.Sakkeer
1 hour ago