【问题标题】:NodeJS Issue with Ubuntu server with Docker带有 Docker 的 Ubuntu 服务器的 NodeJS 问题
【发布时间】:2020-02-26 05:15:19
【问题描述】:

我使用以下命令安装 nodejs: sudo apt install nodejs 然后当安装完成 我试图运行一些脚本但有错误

[我的脚本命令]

当我使用 nodejs 运行此脚本时,会发生错误

我的ubuntu版本和Nodejs版本:

【问题讨论】:

    标签: node.js ubuntu


    【解决方案1】:

    卸载那个nodejs版本

    sudo apt-get remove nodejs
    

    安装最新版本的nodejs

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

    在此之后尝试运行您的文件

    node yourfile
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 2021-03-17
      • 2020-08-03
      • 2016-11-21
      • 1970-01-01
      • 2015-03-24
      • 1970-01-01
      相关资源
      最近更新 更多