1

所以我在这个链接上向我自己的仓库添加了一个安装脚本: https ://github.com/quinnliu/Install_Scripts/blob/master/install_node_and_NPM

但是当我输入 wget 时,我会得到一个名称正确的文件,但有一大堆 .html 代码而不是安装命令。有人知道为什么吗?

这是我得到的文件的开头:

<!DOCTYPE html>
<html>
  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Install_Scripts/install_node_and_NPM at master <C2><B7> quinnliu/Install_Scripts <C2><B7> GitHub</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png" />
4

2 回答 2

0

您可能想要下载原始文件

于 2013-07-10T23:15:37.827 回答
0

如前所述,您需要原始链接

$ wget -qO- raw.github.com/quinnliu/Install_Scripts/master/install_node_and_NPM

#!/bin/bash

sudo apt-get update

# Install a special package
$ sudo apt-get install -y python-software-properties python g++ make

# Add a new repository for apt-get to search
$ sudo add-apt-repository ppa:chris-lea/node.js

# Update apt-get's knowledge of which packages are where
$ sudo apt-get update

# Now install nodejs and npm
sudo apt-get install -y nodejs
sudo apt-get install npm
于 2013-07-10T23:29:05.870 回答