问题描述
我尝试从PowerShell(以管理员身份)使用以下命令
I try the following command from PowerShell (as Administrator)
npm install @angular2-material
并得到错误:
Unrecognized token in source text.
At line:1 char:13
+ npm install <<<< @angular2-material
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnrecognizedToken
我什至尝试只获取一个A2M组件(核心),并得到相同的错误:
I've even tried getting just a single A2M component (core) and get the same error:
npm install @angular2-material/{core}
知道我在做什么错吗?
npm:3.9.5
节点:6.2.2
操作系统:Win7
Any idea what I'm doing wrong?
npm: 3.9.5
node: 6.2.2
OS: Win7
更新:
我在A2M GitHub上发现了以下问题-似乎可能是PS的问题.
https://github.com/angular/material2/issues/297
Update:
I found the following issue on A2M GitHub - seems like it might be an issue with PS.
https://github.com/angular/material2/issues/297
更新2:
使用cmd代替PS可以工作.
Update 2:
Using cmd instead of PS works.
推荐答案
@使PowerShell将@ angular2-material视为变量.
The @ is making PowerShell treat @angular2-material as a variable.
- 您可以使用cmd.exe(命令外壳)代替PowerShell
或
- 您可以在包装中用引号引起来:例如
"@angular2-material"
这篇关于尝试从npm安装Angular 2材质-源文本中无法识别的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!