Я в моем проекте на работающем узле MAC 8.11.3 и получаю следующую ошибку:
$ npm install
> chacha-native@2.0.2 install /Users/MYUSERNAME/boatnet/observer/obs-web/node_modules/chacha-native
> node-gyp rebuild
Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!
PYTHONPATH is currently: "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib:/usr/local/lib/python2.7/site-packages"
You should `unset PYTHONPATH` to fix this.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/MYUSERNAME/boatnet/observer/obs-web/node_modules/chacha-native
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Файл package.json выглядит следующим образом:
{
"name": "obs-web",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build-webapp": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "node build/patch/patch-electron-fs.js"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.1.4",
"@angular/cdk": "^6.4.7",
"@angular/common": "^7.1.4",
"@angular/compiler": "^7.1.4",
"@angular/core": "^7.1.4",
"@angular/forms": "^7.1.4",
"@angular/http": "^7.1.4",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^7.1.4",
"@angular/platform-browser-dynamic": "^7.1.4",
"@angular/router": "^7.1.4",
"chacha": "^2.1.0",
"core-js": "^2.5.4",
"crypto-pouch": "^3.1.3",
"hammerjs": "^2.0.8",
"moment": "^2.22.2",
"node-gyp": "^3.8.0",
"npm": "^6.4.1",
"pouchdb": "^7.0.0",
"pouchdb-find": "^7.0.0",
"primeicons": "^1.0.0",
"primeng": "^6.1.6",
"rxjs": "^6.3.3",
"stream": "0.0.2",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular/cli": "~7.1.4",
"@angular/compiler-cli": "^7.1.4",
"@angular/language-service": "^7.1.4",
"@types/jasmine": "^2.8.11",
"@types/jasminewd2": "^2.0.6",
"@types/node": "^8.10.38",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~3.1.6"
}
}
Iпопытался создать виртуальную среду, но все еще возникают проблемы.Мне пришлось использовать учетную запись администратора для установки node-gyp, но я не уверен, что это проблема здесь.
python -V возвращает «Python 2.7.14». Я даже пытался сбросить PYTHONPATH, и я получил ту же ошибку.