Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js aws sdk/clients/cognitoidentity没有导出的成员';字符串';_Node.js_Aws Sdk_Aws Amplify - Fatal编程技术网

Node.js aws sdk/clients/cognitoidentity没有导出的成员';字符串';

Node.js aws sdk/clients/cognitoidentity没有导出的成员';字符串';,node.js,aws-sdk,aws-amplify,Node.js,Aws Sdk,Aws Amplify,在启动angular 6.1.2项目时,我有以下错误: 错误 节点_模块/aws放大角度/lib/components/storage/photo picker component/photo picker.factory.d.ts(3,10): 错误TS2305:模块 “/Users/knewtone/Dropbox/knewtone.com/projects/WorkSpace/softwares/yet.marketing/node_modules/aws sdk/clients/cogn

在启动angular 6.1.2项目时,我有以下错误:

错误 节点_模块/aws放大角度/lib/components/storage/photo picker component/photo picker.factory.d.ts(3,10): 错误TS2305:模块 “/Users/knewtone/Dropbox/knewtone.com/projects/WorkSpace/softwares/yet.marketing/node_modules/aws sdk/clients/cognitoidentity” 没有导出的成员“字符串”

package.json

{
    "name": "******",
    "version": "3.0.2",
    "license": "UNLICENSED",
    "config": {
        "host": "****",
        "cloudfront": "******",
        "spechost": "******",
        "speccloudfront": "*******"
    },
    "scripts": {
        "ng": "ng",
        "start": "[ -f src/aws-exports.js ] && mv src/aws-exports.js src/aws-exports.ts || ng serve; ng serve",
        "build": "npm run commit && [ -f src/aws-exports.js ] && mv src/aws-exports.js src/aws-exports.ts || ng build --configuration=production; ng build --configuration=production && aws  cloudfront create-invalidation --distribution-id $npm_package_config_cloudfront --paths '/*'",
        "commit": "git add -A && git commit -m 'an other commit' && git push",
        "sendConfig": "aws s3 rm s3://******/$npm_package_config_spechost --recursive && aws s3 sync ./specs/$npm_package_config_spechost s3://*****/$npm_package_config_spechost && aws cloudfront create-invalidation --distribution-id $npm_package_config_speccloudfront --paths '/*'",
        "build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
        "serve:ssr": "node dist/server",
        "build:client-and-server-bundles": "ng build --configuration=production && ng run ******:server",
        "webpack:server": "webpack --config webpack.server.config.js --progress --colors"
    },
    "private": true,
    "dependencies": {
        "@angular/animations": "^6.1.2",
        "@angular/common": "^6.1.2",
        "@angular/compiler": "^6.1.2",
        "@angular/core": "^6.1.2",
        "@angular/forms": "^6.1.2",
        "@angular/http": "^6.1.2",
        "@angular/platform-browser": "^6.1.2",
        "@angular/platform-browser-dynamic": "^6.1.2",
        "@angular/platform-server": "^6.1.2",
        "@angular/pwa": "^0.7.2",
        "@angular/router": "^6.1.2",
        "@nguniversal/common": "^6.0.0",
        "@nguniversal/express-engine": "^6.0.0",
        "@nguniversal/module-map-ngfactory-loader": "^6.0.0",
        "aws-amplify": "^1.0.5",
        "aws-amplify-angular": "^1.0.3",
        "aws-sdk": "2.289.0",
        "bootstrap": "^4.1.3",
        "chart.js": "^2.7.2",
        "classlist.js": "^1.1.20150312",
        "core-js": "^2.5.7",
        "jquery": "^3.3.1",
        "lodash": "^4.17.10",
        "ngx-quill": "^3.4.0",
        "popper.js": "^1.14.4",
        "quill": "^1.3.6",
        "sha1": "^1.1.1",
        "ts-loader": "^4.4.2",
        "web-animations-js": "^2.3.1",
        "zone.js": "^0.8.26"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "~0.7.2",
        "@angular/cli": "^6.1.2",
        "@angular/compiler-cli": "^6.1.2",
        "@angular/language-service": "^6.1.2",
        "@types/jquery": "^3.3.5",
        "@types/lodash": "^4.14.116",
        "@types/node": "^10.5.7",
        "codelyzer": "~4.4.3",
        "cpy-cli": "^2.0.0",
        "express": "^4.16.3",
        "http-server": "^0.11.1",
        "protractor": "~5.4.0",
        "reflect-metadata": "^0.1.12",
        "rxjs": "^6.2.2",
        "ts-node": "~7.0.0",
        "tslint": "~5.11.0",
        "typescript": "^2.9.2",
        "webpack-cli": "^3.1.0"
    }
}
更新

我在文件中看到了错误

节点_模块/aws放大角度/lib/components/storage/photo picker component/photo-picker.factory.d.ts


没有错误

这是一个已知问题,已经解决

对于遇到此问题的任何人,只需将您的
aws amplify
版本至少更新为1.1.x,并将
aws amplify angular
版本更新为2.0.x

import { OnInit, ComponentFactoryResolver, OnDestroy, EventEmitter } from '@angular/core';
import { DynamicComponentDirective } from '../../../directives/dynamic.component.directive';
import * as String from 'aws-sdk/clients/cognitoidentity'; // <--- the replaced statement

export declare class PhotoPickerComponent implements OnInit, OnDestroy {
  private componentFactoryResolver;
  framework: String;
  url: string;
  picked: EventEmitter<string>;
  loaded: EventEmitter<string>;
  componentHost: DynamicComponentDirective;
  constructor(componentFactoryResolver: ComponentFactoryResolver);
  ngOnInit(): void;
  ngOnDestroy(): void;
  loadComponent(): void;
}
import { String } from 'aws-sdk/clients/cognitoidentity';
import * as String from 'aws-sdk/clients/cognitoidentity';