Angular-cli: ng new is taking long and failing :(

Created on 2 Jul 2016  Â·  13Comments  Â·  Source: angular/angular-cli

  1. OS? Windows 8.1
  2. Versions. Please run ng --version. If there's nothing outputted, please
    run in a Terminal:
    node --version : v6.2.2
    And paste the result here.

(node:6864) fs: re-evaluating native module sources is not supported. If you are
using the graceful-fs module, please update it to a more recent version.
angular-cli: 1.0.0-beta.5
node: 6.2.2
os: win32 x64

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    NA
  2. The log given by the failure. Normally this include a stack trace and some
    more information.

\ Installing packages for tooling via npm
typings ERR! message Unable to connect
to "https://api.typings.org/entries/dt/angular-protractor/tags/1.5.0%2B201604251
43459"
typings ERR! caused by connect ECONNREFUSED 127.0.0.1:3128

typings ERR! cwd D:\CodeAngular\DynForm
typings ERR! system Windows_NT 6.3.9600
typings ERR! command "C:\Program Files\nodejs\node.exe" "D:\CodeAngular\D
ynFormnode_modules\typings\dist\bin.js" "install"
typings ERR! node -v v6.2.2
typings ERR! typings -v 0.8.1
typings ERR! code EUNAVAILABLE

typings ERR! If you need help, you may report this error at:
typings ERR! https://github.com/typings/typings/issues
[email protected] postinstall: typings install
Exit status 1
Error: [email protected] postinstall: typings install
Exit status 1
at EventEmitter. (C:\Users\Pradeepraj.RAppData\Roamingnpm\node_
modules\angular-clinode_modulesnpmlib\utils\lifecycle.js:217:16)
at emitTwo (events.js:106:13)
at EventEmitter.emit (events.js:191:7)
at ChildProcess. (C:\Users\Pradeepraj.RAppData\Roamingnpm\node_
modules\angular-clinode_modulesnpmlib\utils\spawn.js:24:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

Kindly help me with this issue.
Thanks

RFC / discussion / question

Most helpful comment

If you do ng new --skip-install (but make sure you're using a recent like 1.0.0-rc.1), the CLI will not install packages for you. Then you can install them manually.

ng new project-name --skip-install
cd project name
yarn install

I can't help you much with the instalation and usage details of yarn itself, for that you should look at their website: https://yarnpkg.com/en/

All 13 comments

https://github.com/angular/angular-cli/pull/1250 should fix this issue.

Meanwhile you can run npm install manually by using the --skip-npm flag:

ng new project --skip-npm
cd project
npm install

Hello,
I just experienced a similar situation.

ng-new was hanging and I ran your --skip-npm method. And it works. I just wanted to let you know because it's suppose to be fixed according to my understanding.

angular-cli: 1.0.0-beta.10
node: 4.4.3
os: win32 x64

npm -v
2.15.1

node -v
v4.4.3

@kamok in your case, you might have a problem because you're version of node/npm are somewhat old. We only test on node 5/6, which use npm 3.

@filipesilva FWIW, it's still an issue.

I'm on Win 10 with a new install of node and angular-cli.

As with @kamok, the --skip-npm workaround does work for me. It's very, very slow (on the order of about half an hour), but it did eventually install.

I ran the Google/M-Lab internet speed test:
47.3 Mbps download
46.0 Mbps upload
Latency: 25 ms
Server: New York, NY
Your Internet speed is fast

Your Internet connection should be able to handle multiple devices streaming HD videos at the same time.

ng -v
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".

                         _                           _  _

__ _ _ __ __ _ _ _ | | __ _ _ __ ___ | |(_)
/ _|| '_ \ / _ || | | || | / _` || '__|_____ / __|| || |
| (_| || | | || (_| || |_| || || (_| || | |_____|| (__ | || |
__,_||_| |_| __, | __,_||_| __,_||_| ___||_||_|
|___/
angular-cli: 1.0.0-beta.28.3
node: 7.7.1
os: win32 x64

npm -v
4.3.0

@toneware are you saying that when you do these commands it's fast?

ng new project --skip-npm
cd project
npm install

And when you just do ng new project it's slow?

When I do ng new project, it never finishes.

When I use the --skip-npm approach, is very slow.

Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message --------
From: Filipe Silva notifications@github.com
Date: 3/6/17 07:59 (GMT-05:00)
To: angular/angular-cli angular-cli@noreply.github.com
Cc: toneware toneware4391@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [angular/angular-cli] ng new is taking long and failing :( (#1270)

@tonewarehttps://github.com/toneware are you saying that when you do these commands it's fast?

ng new project --skip-npm
cd project
npm install

And when you just do ng new project it's slow?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/angular/angular-cli/issues/1270#issuecomment-284389235, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APZ7XYhBcWy96r0KZ6sj_NKzAPcFf_JZks5rjAMagaJpZM4JDtEm.

If even skipping npm and installing it manually takes a long time, then it sounds like there's a problem in your system/connectivity to npm.

I'd also like to mention that in newer releases its not --skip-npm anymore, but rather --skip-install.

Ok. Good to know. I was just following the suggestions in the thread. FWIW, --skip-npm does work, but I'll try --skip-install when I am home.

I posted my versions, along with my Internet connection speeds. Should I be pointing at a different npm url or something? Everything I used was whatever was installed/configured by default.

Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message --------
From: Filipe Silva notifications@github.com
Date: 3/6/17 15:47 (GMT-05:00)
To: angular/angular-cli angular-cli@noreply.github.com
Cc: toneware toneware4391@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [angular/angular-cli] ng new is taking long and failing :( (#1270)

If even skipping npm and installing it manually takes a long time, then it sounds like there's a problem in your system/connectivity to npm.

I'd also like to mention that in newer releases its not --skip-npm anymore, but rather --skip-install.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/angular/angular-cli/issues/1270#issuecomment-284527173, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APZ7XfMFMLl0cXAKycWovRnc3-1sHF60ks5rjHD0gaJpZM4JDtEm.

I don't think you should need to do that, no... but if npm is giving you problems, you might also try yarn (https://yarnpkg.com/en/).

I didn't see any real difference between --skip-install and --skip-npm.

How can I use yam from the ng cli?

If you do ng new --skip-install (but make sure you're using a recent like 1.0.0-rc.1), the CLI will not install packages for you. Then you can install them manually.

ng new project-name --skip-install
cd project name
yarn install

I can't help you much with the instalation and usage details of yarn itself, for that you should look at their website: https://yarnpkg.com/en/

Yes! I have tried every trick I could find, but now, finally, this works for me.
Although yarn install still took over 500 seconds! Must be my connection; certainly not 'high-speed'.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmurphzyo picture jmurphzyo  Â·  3Comments

rajjejosefsson picture rajjejosefsson  Â·  3Comments

hareeshav picture hareeshav  Â·  3Comments

NCC1701M picture NCC1701M  Â·  3Comments

naveedahmed1 picture naveedahmed1  Â·  3Comments