gpt4 book ai didi

angular - Lodash index.d.ts :244:12 Angular2 web pack build 中的重复标识符 '_'

转载 作者:太空狗 更新时间:2023-10-29 17:31:35 25 4
gpt4 key购买 nike

编辑:见底部

我查阅了大量关于重复标识符问题的文章,但没有找到任何可以帮助我解决此问题的文章。我有以下 package.json:

  "dependencies": {
"@angular/common": "2.3.0",
"@angular/compiler": "2.3.0",
"@angular/core": "2.3.0",
"@angular/forms": "2.3.0",
"@angular/http": "2.3.0",
"@angular/material": "^2.0.0-alpha.11-3",
"@angular/platform-browser": "2.3.0",
"@angular/platform-browser-dynamic": "2.3.0",
"@angular/router": "3.3.0",
"angular2-jwt": "^0.1.26",
"angular2-modal": "^2.0.2",
"bootstrap": "^3.3.7",
"fs": "0.0.1-security",
"gulp": "^3.9.1",
"jquery": "^3.1.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-rc.4",
"stripe": "^4.15.0",
"web-animations-js": "^2.2.2",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angularclass/hmr": "^1.0.1",
"@angularclass/hmr-loader": "^3.0.2",
"@types/es6-shim": "^0.31.32",
"@types/jasmine": "^2.2.29",
"@types/node": "^6.0.38",
"@types/selenium-webdriver": "2.53.33",
"angular2-router-loader": "^0.3.4",
"angular2-template-loader": "^0.6.0",
"autoprefixer": "^6.3.2",
"awesome-typescript-loader": "^2.2.4",
"codelyzer": "1.0.0-beta.3",
"copy-webpack-plugin": "^4.0.0",
"css-loader": "^0.25.0",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.9.0",
"html-loader": "^0.4.0",
"html-webpack-plugin": "^2.8.1",
"imports-loader": "^0.7.0",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "^2.3.4",
"jasmine-spec-reporter": "^2.4.0",
"json-loader": "^0.5.3",
"karma": "1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.0.3",
"karma-remap-istanbul": "0.2.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "1.8.0",
"node-sass": "^3.4.2",
"null-loader": "0.1.1",
"postcss-loader": "^1.1.0",
"protractor": "^4.0.10",
"raw-loader": "0.5.1",
"remap-istanbul": "^0.6.4",
"resolve-url": "^0.2.1",
"resolve-url-loader": "^1.6.1",
"rimraf": "^2.5.1",
"sass-loader": "^4.0.2",
"shelljs": "^0.7.0",
"style-loader": "^0.13.1",
"ts-helpers": "^1.1.1",
"tslint": "^3.4.0",
"tslint-loader": "^2.1.0",
"typedoc": "^0.5.1",
"typescript": "2.0.10",
"url-loader": "^0.5.7",
"webpack": "^2.1.0-beta.25",
"webpack-dashboard": "^0.2.0",
"webpack-dev-server": "2.1.0-beta.9"
}
}

然后在我的 tsconfig.json 里面

{
"compilerOptions": {
"target": "es6",
"lib": ["dom", "es5"],
"typeRoots": [
"./node_modules/@types"
],
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"noImplicitAny": false
},
"compileOnSave": false,
"buildOnSave": false,
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
},
"exclude": [
"node_modules",
"**/*.spec.ts",
"dist"
]
}

但每次我尝试运行 webpack 构建时,我都会得到:

node_modules/@types/lodash/index.d.ts:244:12 重复标识符“_”

所以我的几个包裹似乎互相干扰了?有谁知道哪些?感谢您的帮助

编辑 我找到了构建冲突的原因,看来我已经找到了

node_modules/lodash 同时我有 node_modules/@types/lodash,现在我如何找到安装 lodash 类型的包类型?

最佳答案

"@types/lodash": "ts2.0", 添加到 package.json 对我有用。 https://github.com/driftyco/ionic-app-scripts/issues/700

希望对您有所帮助。 :)

关于angular - Lodash index.d.ts :244:12 Angular2 web pack build 中的重复标识符 '_',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42079070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com