对于我的大部分项目,我已经成功地从 npm 迁移到了 Yarn。但是我的 Angular 2 项目导致错误:
$ yarn add "@angular/common"
yarn add v0.17.8
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "@angular/common" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
即使使用 Angular 提供的快速入门之一:
$ git clone https://github.com/angular/quickstart.git quickstart && cd quickstart
…
$ yarn install
yarn install v0.17.8
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "@types/node" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
我错过了一些明显的东西吗?我在任何地方都没有看到有这个问题的任何其他帖子,所以这可能是环境问题?
$ yarn versions
yarn versions v0.17.8
{ yarn: '0.17.8',
'angular-quickstart': '1.0.0',
http_parser: '2.7.0',
node: '6.9.1',
v8: '5.1.281.84',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2j' }
Done in 0.06s.
(我在 linux/f25 上运行)
我觉得它与作用域包名称中的 @-symbol 有关?