毛线全局安装:“ adonis:找不到命令”

时间:2019-11-29 13:49:20

标签: yarnpkg adonis.js

在Ubuntu 18(在WSL2 VM上运行)上用yarn安装了Adonis:

pomatti@NT-03024:~/Projects/myApp$ yarn global add @adonisjs/cli
yarn global v1.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@adonisjs/cli@4.0.12" with binaries:
      - adonis
Done in 3.29s.

但是,当我尝试运行它时,找不到该命令:

pomatti@NT-03024:~/Projects/myApp$ adonis
adonis: command not found

奇怪的是我的package.json命令可以正常运行,并且我的应用已启动,但是我无法直接在命令行(全局安装)中调用adonis

例如,yarn migration && adonis serve --dev --debug有效。

"scripts": {
    "serve": "adonis serve",
    "migration": "adonis migration:run",
    "start": "yarn migration && yarn serve",
    "dev": "yarn migration && adonis serve --dev --debug",
    "lint": "yarn eslint"
  },

1 个答案:

答案 0 :(得分:1)

尝试使用NPM安装。命令:

> npm i -g @adonisjs/cli

Official documentation