相关疑难解决方法(0)

尝试安装任何模块时"消息无法从注册表中获取"

我无法从npm安装任何节点模块.

npm install socket.io
Run Code Online (Sandbox Code Playgroud)

上面的命令产生了以下输出,它无法安装socket.io

npm http GET https://registry.npmjs.org/socket.io

npm ERR! Error: failed to fetch from registry: socket.io
npm ERR!     at /opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:32:9)
npm ERR!     at Request._callback (/opt/node0610/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:137:18)
npm ERR!     at Request.callback (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:109:22)
npm ERR!     at Request.<anonymous> (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:198:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/opt/node0610/lib/node_modules/npm/node_modules/request/main.js:195:10)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at CleartextStream.<anonymous> (http.js:1134:11)
npm ERR!     at CleartextStream.emit (events.js:67:17)
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! …
Run Code Online (Sandbox Code Playgroud)

node.js npm

349
推荐指数
9
解决办法
19万
查看次数

'Observable <T>'不是从'Observable <T>派生的类

当尝试从node_modulestypescript编译器中的类扩展类时抛出一个错误说:

Property 'source' is protected but type 'Observable<T>' is not a class derived from 'Observable<T>'.

这只发生在基类来自a时node_module.

基类看起来像:

import {Observable} from "rxjs/Observable";
export abstract class TestBase<T> {

    request(options: any):Observable<T> {
        return Observable.throw(new Error('TestBase is abstract class. Extend it and implement own request method'));
    }
}
Run Code Online (Sandbox Code Playgroud)

在项目中对其进行子类化:

import {Observable} from "rxjs/Observable";
import {TestBase} from "@org/core";

class SocketResponse {

}

class Socket {
    request(): Observable<SocketResponse> {
        return new Observable.of(new SocketResponse());
    }
}

export class Sub extends TestBase<SocketResponse> {
    request(options:any):Observable<SocketResponse> …
Run Code Online (Sandbox Code Playgroud)

typescript rxjs5

38
推荐指数
5
解决办法
9614
查看次数

安装带纱线的包装时,"未满足的同伴依赖性"是什么意思?

我有一个全新安装yarn(通过npm install yarn -g)并试图安装一些包

yarn add vue-loader babel-loader style-loader css-loader file-loader webpack
Run Code Online (Sandbox Code Playgroud)

我在安装过程中收到了一些警告,例如

warning "vue-loader@13.3.0" has unmet peer dependency "vue-template-compiler@^2.0.0".
Run Code Online (Sandbox Code Playgroud)

这究竟是什么意思,具体而言:为什么不自行yarn安装这些依赖项?(如果需要的话)

关于同一主题的姐妹问题(关于npm)产生一些答案,其表明i)更新npmii)删除node_modules因为存在npm关于处理依赖性的错误.

这种警告的状态是什么yarn这真的是一个警告(=我可以丢弃的东西)?我不能丢弃它们(webpack构建失败)并且必须手动安装它们.同时,安装了很多依赖项,所以我不明白为什么会错过一些(虽然它们可以手动安装)

yarnpkg

37
推荐指数
3
解决办法
2万
查看次数

如何撤消npm update?

有没有办法撤消命令npm update?我运行命令,现在我有一堆未满足的依赖项和一些错误.

我正在尝试手动重新安装并修复所有错误但是有谁知道如何基本上恢复npm update

node.js npm

14
推荐指数
2
解决办法
2万
查看次数

为什么npm list -g导致npm ERR!遗失错误?

npm使用后返回以下消息 npm list -g

npm ERR! missing: atom-package-manager@*, required by undefined@undefined
npm ERR! missing: opal-npm-wrapper@git://github.com/anthonny/opal-npm-wrapper.git#0.1.1, required by asciidoctor.js@1.5.2
npm ERR! missing: xmlhttprequest@~1.6.0, required by asciidoctor.js@1.5.2
Run Code Online (Sandbox Code Playgroud)

截图:

node.js npm

14
推荐指数
2
解决办法
7791
查看次数

UNMET PEER DEPENDENCY react-router@3.0.0

安装"react-bootstrap-table"后出错.

??? react@15.4.1 
??? UNMET PEER DEPENDENCY react-router@3.0.0
Run Code Online (Sandbox Code Playgroud)

我的package.json

"dependencies": {
    "isomorphic-fetch": "^2.2.1",
    "react": "^15.4.0",
    "react-addons-linked-state-mixin": "^15.4.0",
    "react-bootstrap": "^0.30.6",
    "react-bootstrap-table": "^2.6.0",
    "react-cookie": "^0.4.8",
    "react-dom": "^15.4.0",
    "react-redux": "^4.4.6",
    "react-router": "^3.0.0",
    "react-router-apply-middleware": "0.0.2",
    "react-router-bootstrap": "^0.23.1",
    "react-router-relative-links": "^0.1.0",
    "redux": "^3.6.0",
    "redux-logger": "^2.7.4",
    "redux-promise-middleware": "^4.1.0",
    "redux-thunk": "^2.1.0"
  }
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

reactjs

5
推荐指数
1
解决办法
1058
查看次数

类型为Alert时,不存在Ionic 2警报组件属性创建

Alert Component在我的ionic 2项目中导入如下:

import {Alert } from 'ionic-angular';
Run Code Online (Sandbox Code Playgroud)

用法:

let alert = this.alert.create({
    title: 'New Friend!',
    subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!',
      buttons: ['OK']
    });
alert.present();
Run Code Online (Sandbox Code Playgroud)

但我的错误是: Property create does not exist on type Alert.

离子信息:

Cordova CLI: 6.3.0
Gulp version:  CLI version 1.2.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS …
Run Code Online (Sandbox Code Playgroud)

alert components ionic2

2
推荐指数
1
解决办法
5076
查看次数

标签 统计

node.js ×3

npm ×3

alert ×1

components ×1

ionic2 ×1

reactjs ×1

rxjs5 ×1

typescript ×1

yarnpkg ×1