这最近开始在命令行中弹出......任何人都知道发生了什么,我不确定为什么 node_modules 中的新包与 node v14.16 不兼容。我尝试使用旧版本的节点(adonis 5 的文档状态最小版本是版本 12),尽管这会产生语法错误。
每当使用 node ace 命令时都会显示此container.with() is deprecated
警告。我该如何解决这些问题?
节点版本 14.16.0:
node --trace-warnings ace migration:rollback
(node:24088) container.with() is deprecated. Use container.withBindings() instead: DeprecationWarning
at Ioc.with (C:\project\node_modules\@adonisjs\fold\build\src\Ioc\index.js:421:17)
at DatabaseServiceProvider.registerHealthChecker (C:\project\node_modules\@adonisjs\lucid\build\providers\DatabaseProvider.js:93:32)
at DatabaseServiceProvider.boot (C:\project\node_modules\@adonisjs\lucid\build\providers\DatabaseProvider.js:140:14)
at Registrar.boot (C:\project\node_modules\@adonisjs\fold\build\src\Registrar\index.js:116:32)
at C:\project\node_modules\@adonisjs\application\build\src\Application.js:543:13
at Profiler.profileAsync (C:\project\node_modules\@adonisjs\application\node_modules\@adonisjs\profiler\build\src\Profiler\AbstractProfiler.js:20:32)
at Application.bootProviders (C:\project\node_modules\@adonisjs\application\build\src\Application.js:541:9)
at App.wire (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:192:9)
at App.onFind (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:145:13)
at Hooks.execute (C:\project\node_modules\@adonisjs\ace\build\src\Hooks\index.js:44:13)
(node:24088) container.with() is deprecated. Use container.withBindings() instead: DeprecationWarning
at Ioc.with (C:\project\node_modules\@adonisjs\fold\build\src\Ioc\index.js:421:17)
at DatabaseServiceProvider.defineValidationRules (C:\project\node_modules\@adonisjs\lucid\build\providers\DatabaseProvider.js:109:32)
at DatabaseServiceProvider.boot (C:\project\node_modules\@adonisjs\lucid\build\providers\DatabaseProvider.js:141:14)
at Registrar.boot (C:\project\node_modules\@adonisjs\fold\build\src\Registrar\index.js:116:32)
at C:\project\node_modules\@adonisjs\application\build\src\Application.js:543:13
at Profiler.profileAsync (C:\project\node_modules\@adonisjs\application\node_modules\@adonisjs\profiler\build\src\Profiler\AbstractProfiler.js:20:32)
at Application.bootProviders (C:\project\node_modules\@adonisjs\application\build\src\Application.js:541:9)
at App.wire (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:192:9)
at App.onFind (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:145:13)
at Hooks.execute (C:\project\node_modules\@adonisjs\ace\build\src\Hooks\index.js:44:13)
(node:24088) container.with() is deprecated. Use container.withBindings() instead: DeprecationWarning
at Ioc.with (C:\project\node_modules\@adonisjs\fold\build\src\Ioc\index.js:421:17)
at AuthProvider.boot (C:\project\node_modules\@adonisjs\auth\build\providers\AuthProvider.js:32:40)
at Registrar.boot (C:\project\node_modules\@adonisjs\fold\build\src\Registrar\index.js:116:32)
at C:\project\node_modules\@adonisjs\application\build\src\Application.js:543:13
at Profiler.profileAsync (C:\project\node_modules\@adonisjs\application\node_modules\@adonisjs\profiler\build\src\Profiler\AbstractProfiler.js:20:32)
at Application.bootProviders (C:\project\node_modules\@adonisjs\application\build\src\Application.js:541:9)
at App.wire (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:192:9)
at App.onFind (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:145:13)
at Hooks.execute (C:\project\node_modules\@adonisjs\ace\build\src\Hooks\index.js:44:13)
at Kernel.find (C:\project\node_modules\@adonisjs\ace\build\src\Kernel\index.js:371:13)
(node:24088) container.with() is deprecated. Use container.withBindings() instead: DeprecationWarning
at Ioc.with (C:\project\node_modules\@adonisjs\fold\build\src\Ioc\index.js:421:17)
at AuthProvider.boot (C:\project\node_modules\@adonisjs\auth\build\providers\AuthProvider.js:37:40)
at Registrar.boot (C:\project\node_modules\@adonisjs\fold\build\src\Registrar\index.js:116:32)
at C:\project\node_modules\@adonisjs\application\build\src\Application.js:543:13
at Profiler.profileAsync (C:\project\node_modules\@adonisjs\application\node_modules\@adonisjs\profiler\build\src\Profiler\AbstractProfiler.js:20:32)
at Application.bootProviders (C:\project\node_modules\@adonisjs\application\build\src\Application.js:541:9)
at App.wire (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:192:9)
at App.onFind (C:\project\node_modules\@adonisjs\core\build\src\Ignitor\Ace\App\index.js:145:13)
at Hooks.execute (C:\project\node_modules\@adonisjs\ace\build\src\Hooks\index.js:44:13)
at Kernel.find (C:\project\node_modules\@adonisjs\ace\build\src\Kernel\index.js:371:13)
节点版本 12.5.0:
node ace migration:rollback
C:\project\node_modules\@poppinss\utils\build\src\Helpers\string.js:241
return `${values[0]}${options?.pairSeparator || ' and '}${values[1]}`;
^
SyntaxError: Unexpected token .
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (C:\project\node_modules\@poppinss\utils\build\src\Helpers\index.js:56:31)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)