2017-06-14 100 views
0

这是我做了什么,我创建无业游民机,这是我的Vagrantfile包安装失败,角上流浪

Vagrant.configure("2") do |config| 
    config.vm.box = "hashicorp/precise64" 
    config.vm.provision :shell, path: "bootstrap.sh" 
    config.vm.network :forwarded_port, guest: 80, host: 4567 
end 

和我的bootstrap.sh

#!/usr/bin/env bash 

apt-get update 
apt-get install -y apache2 
if ! [ -L /var/www ]; then 
    rm -rf /var/www 
    ln -fs /vagrant /var/www 
fi 

我只是无业游民了,我可以看到http://127.0.0.1:4567/没有问题。

于是我着手https://angular.io/guide/quickstart

vagrant ssh 

它说

Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)

然后(在命令和apt-get安装卷曲)上https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 
sudo apt-get install -y nodejs 

没有错误的指示,这点。

然后我跟(命令和apt-get安装NPM之后)

sudo npm install -g @angular/cli 

继续我得到这个错误

Error: failed to fetch from registry: angular-cli

不知道该怎么做,只是想试试角。谢谢!

+0

你会想以此来发表您的package.json内容有人能够帮助。它看起来像NPM试图安装的软件包之一有一个它自己的无效的package.json,所以缩小你想要安装的软件将会有所帮助。 –

+0

尝试检查Angular Cli是否正确安装ng --version – CharanRoot

+0

只是试图重复过程,所以我可以写出更详细的问题,并且无法通过安装angular-cli – Nemanja

回答

0

第一组NPM配置礼

npm config set registry https://registry.npmjs.org/ 

,并尝试安装CLI的全球水平

sudo npm uninstall -f -g @angular/cli 
sudo npm cache clean 
sudo npm install -g @angular/[email protected] 
+0

当我尝试'npm uninstall -g @ angular/cli'我得到'npm WARN未安装在/ usr/local/lib/node_modules @ angular/cli'中时,我试图清理缓存并重新安装,但是再次出现同样的错误 – Nemanja

+0

在npm命令之前添加了sudo。更新了我的答案。 – CharanRoot

+0

sudo npm uninstall -f -g @ angular/cli然后'npm ERR!'后,我仍然得到'npm WARN未安装在/ usr/local/lib/node_modules @ angular/cli'错误:无法从注册表中获取:angular/cli'在最后一行之后,感谢您的回复,并为我迟到的回复感到抱歉! – Nemanja