在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"
},