簡體   English   中英

相同的package.json不能在Windows和Mac中運行

[英]same package.json doesn't run in windows and mac

嘗試在Windows中啟動我的應用程序時出現以下錯誤。

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
[0]           ^^^^
[0] ^^^
[0]
[0] SyntaxError: missing ) after argument list

我缺少任何解釋或軟件包嗎?

這是我的package.json,請讓我知道一些特定於Mac的腳本,可能會導致上述錯誤,根據我的分析,它是圍繞服務器或更新的:watch package.json

{
  "name": "documentation-playground",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "concurrently --kill-others \"npm run server\" \"npm run update:watch\"",
    "server": "node --max_old_space_size=8192  ./node_modules/.bin/ng serve --aot --progress false --proxy-config proxy.config.json --port 8888",
    "mock": "node json-server/json-server.js",
    "update:watch": "onchange \"json-server/**/*.json\" -i -- npm run mock",
    "npm-install": "rimraf ./src/app/core && rimraf ./node_modules/woa-core-ng-module && npm i",
    "test": "concurrently --kill-others  \"npm run mock\" \"ng test --source-map=false\"",
    "start-prod": "concurrently --kill-others \"npm run server-prod\" \"npm run update:watch\"",
    "server-prod": "ng serve --configuration=production --progress true --proxy-config proxy.config.json",
    "start-demo": "ng serve --configuration=demo",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "protractor",
    "lint": "ng lint",
    "build:clean": "rimraf ./dist/public",
    "prebuild": "npm run build:clean",
    "build:aot": "./node_modules/.bin/ng build --aot",
    "build": "./node_modules/.bin/ng build --prod --configuration=production --deploy-url=documentation-playground/",
    "prebuild:demo": "npm run build:clean",
    "build:demo": "./node_modules/.bin/ng build --prod --configuration=demo --deploy-url=documentation-playground/",
    "postbuild:demo": "mv ./dist/public/documentation-playground/documentation-playground-index.html ./dist/public/documentation-playground/index.html",
    "postbuild": "rimraf ./dist/public/documentation-playground/assets/i18n/en.json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.1.0",
    "@angular/common": "^6.1.0",
    "@angular/compiler": "^6.1.0",
    "@angular/core": "^6.1.0",
    "@angular/forms": "^6.1.0",
    "@angular/http": "^6.1.0",
    "@angular/platform-browser": "^6.1.0",
    "@angular/platform-browser-dynamic": "^6.1.0",
    "@angular/router": "^6.1.0",
    "core-js": "^2.5.4",
    "rxjs": "6.3.3",
    "zone.js": "~0.8.26",
    "@ngx-translate/core": "10.0.0",
    "@ngx-translate/http-loader": "3.0.0",
    "classlist.js": "1.1.20150312",
    "jsonschema": "1.1.1",
    "moment": "^2.18.1",
    "ngx-drag-drop": "^1.1.0",
    "ngx-perfect-scrollbar": "^7.0.0",
    "ngx-responsive": "6.0.0",
    "ngx-translate-multi-http-loader": "^2.1.2",
    "resize-observer-polyfill": "^1.5.0",
    "stacktrace-js": "2.0.0",
    "web-animations-js": "^2.3.1",
    "cp-cli": "^1.1.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.6.7",
    "@angular/cli": "~6.1.2",
    "fs": "0.0.1-security",
    "@angular/compiler-cli": "^6.1.0",
    "@angular/language-service": "^6.1.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2",
    "onchange": "^3.2.1",
    "concurrently": "3.4.0",
    "json-server": "0.9.6",
    "rimraf": "2.6.2"
  }
}

有時,較小的版本更改可能會破壞事情。 從在Mac上進行npm install到在Window上進行npm install ,可能會發生單色版本更改。 因此,建議將package-lock.json在git中,並在每次更新package.json時對其進行更新。 另外,並非所有軟件包都與所有平台兼容。 我相信您可以通過調用堆棧確定導致節點模塊出現問題的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM