量角器错误 - @types/茉莉花' 不在 npm 注册表中



我正在尝试安装量角器,但收到以下错误。命令:npm install -g protractor

npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code E404
npm ERR! 404 no such package available : @types/jasmine
npm ERR! 404
npm ERR! 404 '@types/jasmine' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'protractor'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR!     F:tempchrome downloadsnpm-debug.log

我今天遇到了这个问题,我的问题是我在npm配置文件中设置了一个自定义注册表。你用过"npm set registry"吗?如果是这样,你可以用下面的命令手动告诉npm在哪里查找'@types'注册表:

问题是由于您使用的私有注册表尚未添加对@organization包的支持。就我而言,我使用的是Sonatype Nexus,我的版本不支持这些类型的软件包。@Willie Valdez的建议可能是目前对你最好的解决方案。

同时,检查你的主目录或项目目录中是否有.npmrc文件。注册表可能在那里。如果是这种情况,只需将文件重命名为npmrc_bak或其他名称,直到安装软件包,然后恢复到原始名称。

您还可以在当前项目中包含.npmrc文件,详细信息如下:

@angular:registry=https://registry.npmjs.org
@types:registry=https://registry.npmjs.org
@ngtools:registry=https://registry.npmjs.org
@angular-cli:registry=https://registry.npmjs.org

最新更新