当我运行以下命令时
ng set --global packageManager=yarn
我收到以下消息
"get/set have been deprecated in favor of the config command"
当我跑步时---
ng config cli.packageManager yarn
我收到以下错误消息
Cannot read property 'value' of null
TypeError: Cannot read property 'value' of null
at ConfigCommand.set (C:\Users\Rahul\AppData\Roaming\npm\node_modules\@angular\cli\commands\config.js:207:36)
at ConfigCommand.run (C:\Users\Rahul\AppData\Roaming\npm\node_modules\@angular\cli\commands\config.js:181:18)
at C:\Users\Rahul\AppData\Roaming\npm\node_modules\@angular\cli\models\command-runner.js:278:30
at Generator.next (<anonymous>)
at fulfilled (C:\Users\Rahul\AppData\Roaming\npm\node_modules\@angular\cli\models\command-runner.js:4:58)
at <anonymous>
我该如何解决这个问题?
以下是版本信息 我使用的是Java 8。
NPM version - 5.6.0
Yarn version --1.7.0
ng - v给出了以下结果。我想使用Angular js
Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
答案 0 :(得分:0)
如果要全局设置,请改用此设置:b.__rmul__(a)
如果您尝试在本地设置它,则可能会遇到问题,ng config -g cli.packageManager yarn
会为您构建程序包,直到完成此操作,您才需要配置本地程序包。