简体   繁体   中英

Can't install angular-cli

angular-cli just quits during installation:

(myapp)vagrant@myapp-local:/vagrant$ sudo npm install -g angular-cli
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.
(myapp)vagrant@myapp-local:/vagrant$ l mapToRegistry uri https://registry.npmjs.org/serve-static

(myapp)vagrant@myapp-local:/vagrant$ ng
The program 'ng' is currently not installed. To run 'ng' please ask your administrator to install the package 'ng-common'

It seems I have latest versions of both node and npm:

(myapp)vagrant@myapp-local:/vagrant$ npm -v
3.10.9
(myapp)vagrant@myapp-local:/vagrant$ node -v
v6.9.1

Resolved: So the issue was of memory of vagrant machine I increased it and it worked.

config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
end

At last step I had to do:

sudo ln -s   /home/vagrant/node-v6.9.1-linux-x64/lib/node_modules/angular-cli/bin/ng /usr/bin/ng

The problem is that NPM3 is needed. It's not currently mentioned on the readme check this link . Just execute npm install -g npm3 and then use npm3 in place of npm to install or just update npm to the latest version. hope this will work.

Updated

  1. Try to clean cache - npm cache clean ,
  2. Uninstall angular-cli - npm uninstall -g angular-cli
  3. Install again npm install -g angular-cli .
  4. Worse case install angualr cli with a -force flag like this - npm install -g -f angular-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM