【问题标题】:installing nodejs via the downloaded file from website in ubuntu通过从 ubuntu 网站下载的文件安装 nodejs
【发布时间】:2022-11-02 17:00:05
【问题描述】:

我已经从 nodejs 网站下载了 nodejs 存储库,我想通过 bin 目录中的节点文件安装它,我想使用 gdebi 或软件安装程序应用程序安装它,但错误是: 用于 gdebi 和 用于软件安装程序实际上我已经检查了权限并激活了它们,这是我运行 npx create-react-app name 时的错误

 internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'ini'
Require stack:
- /usr/share/nodejs/@npmcli/config/lib/index.js
- /usr/share/nodejs/npm/lib/utils/config/definition.js
- /usr/share/nodejs/npm/lib/utils/config/definitions.js
- /usr/share/nodejs/npm/lib/utils/config/flatten.js
- /usr/share/nodejs/npm/lib/utils/config/index.js
- /usr/share/nodejs/npm/bin/npx-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/share/nodejs/@npmcli/config/lib/index.js:3:13)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/share/nodejs/@npmcli/config/lib/index.js',
    '/usr/share/nodejs/npm/lib/utils/config/definition.js',
    '/usr/share/nodejs/npm/lib/utils/config/definitions.js',
    '/usr/share/nodejs/npm/lib/utils/config/flatten.js',
    '/usr/share/nodejs/npm/lib/utils/config/index.js',
    '/usr/share/nodejs/npm/bin/npx-cli.js'
  ]
}

【问题讨论】:

    标签: node.js reactjs linux react-native ubuntu


    【解决方案1】:
    1. 这只是一个存档文件,不是 debian 包,所以不要尝试使用包管理器打开它
    2. 看起来你下载了一个 arm 版本的 nodejs,你确定你在 arm 上吗?

    【讨论】:

      【解决方案2】:

      如果你不需要那个特定版本的nodejs,你可以安装它扔命令行apt install nodejs -y

      【讨论】:

      • 我已经通过终端下载了,问题在于创建反应目录
      【解决方案3】:

      只剩下一些额外的包,我可以用sudo apt autoremovesudo apt autoclean 处理,然后我通过终端重新安装了nodejs

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-04-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多