【发布时间】:2017-07-31 13:51:02
【问题描述】:
我是一个新手,试图在我的 angular2-meteor 应用程序中使用 kiteconnect npm pacakge,但是当我尝试在我的 app.module.ts 中导入这个包时,它说找不到模块“KiteConnect”。 下面是我在 import 语句下面使用的语句
import {KiteConnect} from 'KiteConnect';
我确信这是非常愚蠢的事情,但有人可以指出我在这里做错了什么。
以下是我的 package.json 的摘录
{
"name": "socially",
"private": true,
"scripts": {
"start": "meteor run",
"test": "meteor test --driver-package practicalmeteor:mocha",
"test:ci": "meteor test --once --driver-package dispatch:mocha-phantomjs"
},
"dependencies": {
"@angular/common": "2.1.2",
"@angular/compiler": "2.1.2",
"@angular/core": "2.1.2",
"@angular/forms": "2.1.2",
"@angular/platform-browser": "2.1.2",
"@angular/platform-browser-dynamic": "2.1.2",
"@angular/router": "3.1.2",
"angular2-meteor": "0.7.0",
"angular2-meteor-accounts-ui": "^1.0.0",
"angular2-meteor-polyfills": "0.1.1",
"angular2-meteor-tests-polyfills": "0.0.2",
"kiteconnect": "^1.1.1",
"meteor-node-stubs": "0.2.3",
"meteor-rxjs": "0.4.3",
"meteor-typings": "1.3.1",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26"
},
"devDependencies": {
"@types/chai": "^3.4.33",
"@types/mocha": "^2.2.32",
"chai": "3.5.0",
"chai-spies": "0.7.1"
}
}
我也尝试过使用包“chalk”,但在导入时又出现了同样的问题。现在我怀疑是因为编辑器(我正在使用 webstorm)还是由于 tsconfig.josn 如下:
{
"compilerOptions": {
"target": "es5",
"lib": [
"es6",
"dom"
],
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": true
},
"exclude": [
"node_modules"
],
"files": [
"typings.d.ts"
],
"compileOnSave": true,
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit": true
}
}
【问题讨论】:
-
可以添加来自您的
packages.json的摘录吗? -
@LibinVarghese,
-
@LibinVarghese,我已经更新了我的问题中的 package.json
标签: angular meteor npm webstorm packages