1

When I install angular/cli I get the following:

$ npm install  @angular/cli

npm WARN saveError ENOENT: no such file or directory, open 
'sandbox2\package.json'
npm WARN enoent ENOENT: no such file or directory, open 
'sandbox2\package.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: [email protected] 
(node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: 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/[email protected]
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
4
  • 2
    Try this, npm install -g @angular/cli Commented Jul 26, 2018 at 12:40
  • And Then, ng new hd12 Commented Jul 26, 2018 at 12:41
  • 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 ? Commented Jul 26, 2018 at 12:41
  • @ A. SakkeerI still get the error: $ ng new hd12 newTree.optimize is not a function Commented Jul 26, 2018 at 12:52

1 Answer 1

4

Problem is with the latest version of angular/cli. $npm install @angular/cli@latest

Used last known working version: npm install --save-dev @angular/[email protected]

Sign up to request clarification or add additional context in comments.

2 Comments

I can confirm the same fix for me. Even 6.1.1 still has the problem. rc0 is the only version I can get to work correctly.
Confirm, I had the same issue and now it is resolved in this version.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.