Angular2-添加hltv api npm后未找到traceur
我刚刚通过npm安装将hltv api npm包直接添加到hltv api文件夹中。 我尝试在component.ts文件中导入它,方法是:Angular2-添加hltv api npm后未找到traceur,angular,npm,npm-install,Angular,Npm,Npm Install,我刚刚通过npm安装将hltv api npm包直接添加到hltv api文件夹中。 我尝试在component.ts文件中导入它,方法是: import { getNews, getResults } from 'hltv-api'; 并将我的systemjs.config.js文件设置为: /** * System configuration for Angular samples * Adjust as nec
import {
getNews,
getResults
} from 'hltv-api';
并将我的systemjs.config.js文件设置为:
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
'hltv-api' : 'npm:hltv-api'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
'hltv-api': {
main: './src/index.js',
defaultExtension: 'js'
}
}
});
})(this);
从src中提取index.js是很奇怪的,但是在npm安装之后,我只得到了那些文件夹。有人能帮我吗
谢谢很抱歉回答这个问题太晚了,希望还是有帮助的 Hltv api是一个node.js模块,您应该使用node为api提供服务。我已经更新了原始回购协议,您应该使用最新版本或模块,以期待工作,因为hltv正在更新网站,这会影响刮削系统。从现在开始(v1.2.1),您可以看到如何创建简单服务器并为API提供服务。我将编写文档,并尝试使用其他功能扩展API 现在,你可以自由地提出一个问题,提出建议或询问任何有关的问题