在Windows 7上的package.json中安装lodash

时间:2017-04-18 18:57:30

标签: angular typescript lodash

我得到的是#34; UNMET"尝试在package.json中安装loadash时出错。 package.json是这样的:

"name": "puppydog-angular",
  "version": "1.0.0",
  "description": "pilot  project",
  "main": "server/index.js",
  "angular-cli": {},
  "scripts": {
    "start": "NODE_ENV=production npm run serve",
    "dev": "GRAPHENEDB_BOLT_URL=bolt://localhost GRAPHENEDB_BOLT_USER=yyyy GRAPHENEDB_BOLT_PASSWORD=xxxxxx npm run serve",
    "serve": "tsc && concurrently \"tsc -w\" \"nodemon ./server/app.js\" ",
    "lint": "tslint ./app/**/*.ts -t verbose",
    "lite": "lite-server",
    "pree2e": "webdriver-manager update",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "gulp": "gulp",
    "rimraf": "rimraf",
    "bundle": "gulp bundle",
    "postbundle": "rimraf dist"
  },
  "engines": {
    "node": "7.2.1"
  },
  "keywords": [],
  "private": true,
  "dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/router": "~3.4.0",
    "@types/lodash": "^4.14.50",
    "@types/node": "^6.0.46",
    "@types/socket.io-client": "^1.4.29",
    "angular-in-memory-web-api": "~0.2.4",
    "angular2-cookie": "^1.2.6",
    "angular2-toaster": "^2.0.0",
    "bcryptjs": "^2.3.0",
    "body-parser": "^1.15.1",
    "bootstrap": "^4.0.0-alpha.6",
    "canonical-path": "0.0.2",
    "codelyzer": "^2.0.0-beta.4",
    "composable-middleware": "^0.3.0",
    "compression": "~1.0.1",
    "concurrently": "^3.1.0",
    "connect-flash": "^0.1.1",
    "cookie-parser": "^1.4.3",
    "core-js": "^2.4.1",
    "cryptr": "^2.0.0",
    "ejs": "~0.8.4",
    "errorhandler": "~1.0.0",
    "express": "^4.13.4",
    "express-error-handler": "^1.1.0",
    "express-jwt": "^3.0.0",
    "express-session": "^1.15.1",
    "express-validator": "^2.20.5",
    "express-validator-errors": "^2.1.0",
    "fnv-plus": "^1.2.12",
    "jsonwebtoken": "^5.0.0",
    "lodash": "^4.17.4",
    "lokijs": "^1.4.3",
    "method-override": "~1.0.0",
    "moment": "^2.17.1",
    "morgan": "~1.0.0",
    "neo4j-driver": "^1.0.2",
    "ng2-bootstrap": "^1.2.0",
    "ng2-select": "^1.2.0",
    "ng2-table": "^1.3.2",
    "ngx-popover": "0.0.16",
    "node-hashtable": "^0.1.1",
    "node-payments": "^0.1.7",
    "nodemon": "latest",
    "passport": "^0.3.2",
    "passport-facebook": "^2.1.1",
    "passport-google-oauth": "^1.0.0",
    "passport-http": "^0.3.0",
    "passport-local": "^1.0.0",
    "passport-twitter": "^1.0.4",
    "rimraf": "^2.5.4",
    "rxjs": "^5.0.1",
    "serve-favicon": "~2.0.1",
    "socket.io": "^1.4.8",
    "socket.io-client": "^1.7.3",
    "socketio-jwt": "^4.5.0",
    "systemjs": "0.19.40",
    "ts-helpers": "^1.1.1",
    "tslint": "^4.0.0",
    "typescript": "~2.1.5",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^2.3.1",
    "@types/jasmine": "2.5.38",
    "@types/lodash": "^4.14.62",
    "@types/node": "^6.0.46",
    "angular-cli": "1.0.0-beta.28.3",
    "codelyzer": "^2.0.0-beta.4",
    "connect-livereload": "~0.4.0",
    "gulp": "^3.9.1",
    "gulp-inline-ng2-template": "2.0.1",
    "gulp-typescript": "2.13.6",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.2",
    "systemjs-builder": "^0.15.16",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.1.5"
  }
}

我相信我已安装了node,angular,typescript,lodash等所有兼容版本,但我一直收到此错误:

C:\puppydog-master>npm run serve

> puppydog-angular@1.0.0 serve C:\puppydog-master
> tsc && concurrently "tsc -w" "nodemon ./server/app.js"

node_modules/@types/lodash/index.d.ts(12847,29): error TS2304: Cannot find name
'object'.
node_modules/@types/lodash/index.d.ts(19587,15): error TS2428: All declarations
of 'WeakMap' must have identical type parameters.
node_modules/@types/lodash/index.d.ts(19587,33): error TS2304: Cannot find name
'object'.

npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! puppydog-angular@1.0.0 serve: `tsc && concurrently "tsc -w" "nodemon ./
server/app.js" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the puppydog-angular@1.0.0 serve script 'tsc && concurrently
"tsc -w" "nodemon ./server/app.js" '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the puppydog-angular pack
age,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "tsc -w" "nodemon ./server/app.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs puppydog-angular
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls puppydog-angular
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\puppydog-master\npm-debug.log

我还尝试了所有可以在SO上找到的lodash解决方案。 任何人都可以看到这里发生了什么......我将不胜感激......谢谢

0 个答案:

没有答案