【问题标题】:Gulp installation error on Laravel in UbuntuUbuntu Laravel 上的 Gulp 安装错误
【发布时间】:2018-09-17 04:53:15
【问题描述】:

我在 Ubuntu 中运行 npm install gulp。显示此错误:

我的服务器是 Ubuntu 16.04。

框架是 Laravel 5.6。

ERROR: npm is known not to run on Node.js v4.2.6
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/

我运行node -v 显示此消息:v4.2.6

我运行sudo apt-get install --only-upgrade nodejs 显示此消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (9.11.1-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

如何解决这个问题?

【问题讨论】:

  • 邮件的哪一部分不清楚?
  • 那是一个非常老的节点版本。获取latest here
  • @UlrichEckhardt,我该怎么办?我安装 nodejs 版本 9 但显示此错误!
  • @UlrichEckhardt,我该怎么办?我安装 nodejs 版本 9 但显示此错误!
  • @DigitalDrifter ,我安装的是第 9 版,但显示此错误!

标签: laravel ubuntu laravel-5 gulp ubuntu-16.04


【解决方案1】:

试试这个.. 首先,完全卸载 nodejs 和 npm。

sudo apt remove nodejs npm

然后,重新安装它:

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

参考:https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

【讨论】:

【解决方案2】:

试试:

sudo apt-get update 
sudo apt-get install nodejs (you already have node so this step is probably not required) 
sudo npm install -g gulp 

这应该可以解决您的问题。

【讨论】:

  • 我安装了 nodejs 版本 9,但是显示这个错误。运行安装后;; nodejs 显示此消息:nodejs is already the newest version (9.11.1-1nodesource1).
猜你喜欢
  • 2018-02-25
  • 1970-01-01
  • 1970-01-01
  • 2018-04-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-04-17
相关资源
最近更新 更多