【问题标题】:npm start returns error 127 while setting up angular-seed applicationnpm start 在设置 angular-seed 应用程序时返回错误 127
【发布时间】:2015-03-19 16:01:54
【问题描述】:

我正在尝试设置angular-seed application

我已经用sudo apt-get install nodejs安装了nodejs

sudo apt-get install npm安装npm

sudo apt-get install bower -g安装凉亭

使用sudo apt-get install nodejs-legacy 安装nodejs-legacy

打开我的 angular-seed 应用程序,运行 npm install。运行完美,没有任何错误。

要启动服务器,我尝试使用npm start,但它返回以下信息和错误。

> angular-seed@0.0.0 prestart /home/venki/Downloads/angular-seed
> npm install


> angular-seed@0.0.0 postinstall /home/venki/Downloads/angular-seed
> bower install


> angular-seed@0.0.0 start /home/venki/Downloads/angular-seed
> http-server -a localhost -p 8000 -c-1

sh: 1: http-server: not found
npm ERR! weird error 127
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

我使用的是 Ubuntu 14.04 LTS。如果需要任何进一步的信息,请告诉我。

【问题讨论】:

    标签: angularjs node.js ubuntu npm bower


    【解决方案1】:

    我假设 nodejs 默认会安装 http-server,但事实证明它没有。

    我使用 http-server 安装了

    sudo npm install -g http-server
    

    在此之后只运行 npm start 。就这样,问题解决了。

    【讨论】:

      【解决方案2】:

      我使用以下方法安装了nodejs-legacy

      apt-get install nodejs-legacy
      

      然后在此之后运行npm

      【讨论】:

        【解决方案3】:

        我必须运行以下两个命令;

        sudo npm install -g http-server
        
        apt-get install nodejs-legacy
        

        然后我的程序尝试使用 NPM 正确运行。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-03-07
          • 2018-12-28
          • 2019-04-18
          • 1970-01-01
          • 2019-06-22
          • 2020-09-30
          • 2018-09-30
          • 1970-01-01
          相关资源
          最近更新 更多