3

使用 Termux 在 Android 上安装 NodeJS 项目时出现问题

我尝试通过运行以下命令使用 Termux 在我的 Android 手机上安装创建一个 Strapi 项目:

yarn create strapi-app strapi-project --quickstart

我收到了这个错误:

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined

这是运行命令时的完整输出:

$ yarn create strapi-app strapi-project --quickstart
yarn create v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-strapi-app@3.0.0-beta.16.3" with binaries:
      - create-strapi-app
internal/validators.js:107
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:107:11)
    at normalizeSpawnArguments (child_process.js:393:3)
    at spawnSync (child_process.js:552:16)
    at execSync (child_process.js:647:15)
    at u (/data/data/com.termux/files/home/.config/yarn/global/node_modules/node-machine-id/dist/index.js:1:7825)
    at module.exports (/data/data/com.termux/files/home/.config/yarn/global/node_modules/strapi-generate-new/lib/index.js:35:15)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/create-strapi-app/create-strapi-app.js:43:1)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
error Command failed.
Exit code: 1
Command: /data/data/com.termux/files/usr/bin/create-strapi-app
Arguments: strapi-project --quickstart
Directory: /data/data/com.termux/files/home/web
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

此错误的原因是什么,我该如何解决?

4

0 回答 0