我正在尝试npm install
但是错误地说我的操作系统不受支持。什么可能解决这个问题?
Elaine-MacBook-Pro:proj1 elaine$ npm install
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code EBADPLATFORM
npm ERR! notsup Not compatible with your operating system or architecture: inotify@1.4.1
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: darwin
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! /Users/elaine/proj1/npm-debug.log
日志在这里:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
2 info using npm@3.9.5
3 info using node@v6.2.2
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
10 silly install loadIdealTree
11 silly cloneCurrentTree Starting
12 silly install cloneCurrentTreeToIdealTree
13 silly cloneCurrentTree Finishing
14 silly loadShrinkwrap Starting
15 silly install loadShrinkwrap
16 silly loadShrinkwrap Finishing
17 silly loadAllDepsIntoIdealTree Starting
18 silly install loadAllDepsIntoIdealTree
19 silly fetchNamedPackageData dev
20 silly mapToRegistry name dev
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry https://registry.npmjs.org/
23 silly mapToRegistry data Result {
23 silly mapToRegistry raw: 'dev',
23 silly mapToRegistry scope: null,
23 silly mapToRegistry name: 'dev',
23 silly mapToRegistry rawSpec: '',
23 silly mapToRegistry spec: 'latest',
23 silly mapToRegistry type: 'tag' }
24 silly mapToRegistry uri https://registry.npmjs.org/dev
25 verbose request uri https://registry.npmjs.org/dev
26 verbose request no auth needed
27 info attempt registry request try #1 at 12:53:06 PM
28 verbose request id b60ea1145944a292
29 verbose etag W/"59766474-22fb"
30 verbose lastModified Mon, 24 Jul 2017 21:19:48 GMT
31 http request GET https://registry.npmjs.org/dev
32 http 304 https://registry.npmjs.org/dev
33 verbose headers { date: 'Fri, 11 Aug 2017 07:23:06 GMT',
33 verbose headers via: '1.1 varnish',
33 verbose headers 'cache-control': 'max-age=300',
33 verbose headers etag: 'W/"59766474-22fb"',
33 verbose headers age: '0',
33 verbose headers connection: 'keep-alive',
33 verbose headers 'x-served-by': 'cache-sin18026-SIN',
33 verbose headers 'x-cache': 'HIT',
33 verbose headers 'x-cache-hits': '1',
33 verbose headers 'x-timer': 'S1502436186.330442,VS0,VE149',
33 verbose headers vary: 'Accept-Encoding, Accept' }
34 silly get cb [ 304,
34 silly get { date: 'Fri, 11 Aug 2017 07:23:06 GMT',
34 silly get via: '1.1 varnish',
34 silly get 'cache-control': 'max-age=300',
34 silly get etag: 'W/"59766474-22fb"',
34 silly get age: '0',
34 silly get connection: 'keep-alive',
34 silly get 'x-served-by': 'cache-sin18026-SIN',
34 silly get 'x-cache': 'HIT',
34 silly get 'x-cache-hits': '1',
34 silly get 'x-timer': 'S1502436186.330442,VS0,VE149',
34 silly get vary: 'Accept-Encoding, Accept' } ]
35 verbose etag https://registry.npmjs.org/dev from cache
36 verbose get saving dev to /Users/elaine/.npm/registry.npmjs.org/dev/.cache.json
37 verbose correctMkdir /Users/elaine/.npm correctMkdir not in flight; initializing
38 silly resolveWithNewModule dev@0.1.3 checking installable status
39 silly cache add args [ 'dev@^0.1.3', null ]
40 verbose cache add spec dev@^0.1.3
41 silly cache add parsed spec Result {
41 silly cache add raw: 'dev@^0.1.3',
41 silly cache add scope: null,
41 silly cache add name: 'dev',
41 silly cache add rawSpec: '^0.1.3',
41 silly cache add spec: '>=0.1.3 <0.2.0',
41 silly cache add type: 'range' }
42 silly addNamed dev@>=0.1.3 <0.2.0
43 verbose addNamed ">=0.1.3 <0.2.0" is a valid semver range for dev
44 silly addNameRange { name: 'dev', range: '>=0.1.3 <0.2.0', hasData: false }
45 silly mapToRegistry name dev
46 silly mapToRegistry using default registry
47 silly mapToRegistry registry https://registry.npmjs.org/
48 silly mapToRegistry data Result {
48 silly mapToRegistry raw: 'dev',
48 silly mapToRegistry scope: null,
48 silly mapToRegistry name: 'dev',
48 silly mapToRegistry rawSpec: '',
48 silly mapToRegistry spec: 'latest',
48 silly mapToRegistry type: 'tag' }
49 silly mapToRegistry uri https://registry.npmjs.org/dev
50 verbose addNameRange registry:https://registry.npmjs.org/dev not in flight; fetching
51 verbose get https://registry.npmjs.org/dev not expired, no request
52 silly addNameRange number 2 { name: 'dev', range: '>=0.1.3 <0.2.0', hasData: true }
53 silly addNameRange versions [ 'dev',
53 silly addNameRange [ '0.1.0',
53 silly addNameRange '0.1.1',
53 silly addNameRange '0.1.2',
53 silly addNameRange '0.1.3',
53 silly addNameRange '0.1.1-d',
53 silly addNameRange '0.1.1-e',
53 silly addNameRange '0.1.1-f',
53 silly addNameRange '0.1.1-g',
53 silly addNameRange '0.1.1-h',
53 silly addNameRange '0.1.1-n',
53 silly addNameRange '0.1.1-p' ] ]
54 silly addNamed dev@0.1.3
55 verbose addNamed "0.1.3" is a plain semver version for dev
56 silly cache afterAdd dev@0.1.3
57 verbose afterAdd /Users/elaine/.npm/dev/0.1.3/package/package.json not in flight; writing
58 verbose correctMkdir /Users/elaine/.npm correctMkdir not in flight; initializing
59 verbose afterAdd /Users/elaine/.npm/dev/0.1.3/package/package.json written
60 silly fetchNamedPackageData inotify
61 silly mapToRegistry name inotify
62 silly mapToRegistry using default registry
63 silly mapToRegistry registry https://registry.npmjs.org/
64 silly mapToRegistry data Result {
64 silly mapToRegistry raw: 'inotify',
64 silly mapToRegistry scope: null,
64 silly mapToRegistry name: 'inotify',
64 silly mapToRegistry rawSpec: '',
64 silly mapToRegistry spec: 'latest',
64 silly mapToRegistry type: 'tag' }
65 silly mapToRegistry uri https://registry.npmjs.org/inotify
66 verbose request uri https://registry.npmjs.org/inotify
67 verbose request no auth needed
68 info attempt registry request try #1 at 12:53:06 PM
69 verbose etag W/"58e14fc4-721f"
70 verbose lastModified Sun, 02 Apr 2017 19:23:48 GMT
71 http request GET https://registry.npmjs.org/inotify
72 http 304 https://registry.npmjs.org/inotify
73 verbose headers { date: 'Fri, 11 Aug 2017 07:23:06 GMT',
73 verbose headers via: '1.1 varnish',
73 verbose headers 'cache-control': 'max-age=300',
73 verbose headers etag: 'W/"58e14fc4-721f"',
73 verbose headers age: '0',
73 verbose headers connection: 'keep-alive',
73 verbose headers 'x-served-by': 'cache-sin18026-SIN',
73 verbose headers 'x-cache': 'HIT',
73 verbose headers 'x-cache-hits': '1',
73 verbose headers 'x-timer': 'S1502436187.895726,VS0,VE137',
73 verbose headers vary: 'Accept-Encoding, Accept' }
74 silly get cb [ 304,
74 silly get { date: 'Fri, 11 Aug 2017 07:23:06 GMT',
74 silly get via: '1.1 varnish',
74 silly get 'cache-control': 'max-age=300',
74 silly get etag: 'W/"58e14fc4-721f"',
74 silly get age: '0',
74 silly get connection: 'keep-alive',
74 silly get 'x-served-by': 'cache-sin18026-SIN',
74 silly get 'x-cache': 'HIT',
74 silly get 'x-cache-hits': '1',
74 silly get 'x-timer': 'S1502436187.895726,VS0,VE137',
74 silly get vary: 'Accept-Encoding, Accept' } ]
75 verbose etag https://registry.npmjs.org/inotify from cache
76 verbose get saving inotify to /Users/elaine/.npm/registry.npmjs.org/inotify/.cache.json
77 verbose correctMkdir /Users/elaine/.npm correctMkdir not in flight; initializing
78 silly resolveWithNewModule inotify@1.4.1 checking installable status
79 silly rollbackFailedOptional Starting
80 silly rollbackFailedOptional Finishing
81 silly runTopLevelLifecycles Starting
82 silly runTopLevelLifecycles Finishing
83 silly install printInstalled
84 verbose stack Error: Unsupported platform for inotify@1.4.1: wanted {"name":"inotify","version":"1.4.1","author":{"name":"Camilo Aguilar","email":"camilo.aguilar@gmail.com"},"email":"camilo.aguilar@gmail.com","keywords":["inotify","watch","monitor","watch files","watch directories"],"license":"MIT","description":"inotify bindings for v8 javascript engine","repository":{"type":"git","url":"git+ssh://git@github.com/c4milo/node-inotify.git"},"os":["linux"],"engines":{"node":">=0.8"},"main":"inotify","dependencies":{"bindings":"^1.2.1","nan":"^2.3.3"},"scripts":{"test":"node-gyp configure build","install":"node-gyp rebuild"},"gypfile":true,"contributors":[{"name":"Adrian Estrada","email":"edsadr@gmail.com"},{"name":"Alexander Makarenko","email":"estliberitas@gmail.com"},{"name":"Brian Ingalls","email":"bingalls@compete.com"},{"name":"Brian White","email":"mscdex@mscdex.net"},{"name":"Camilo Aguilar","email":"camilo.aguilar@gmail.com"},{"name":"Dan VerWeire","email":"dverweire@gmail.com"},{"name":"FrozenCow","email":"frozencow@gmail.com"},{"name":"Michael Boe","email":"mschuylerb@gmail.com"},{"name":"Yannick Croissant","email":"k1der.country@free.fr"},{"name":"ikokostya","email":"ikokostya@gmail.com"}],"gitHead":"c1416dfada3ca4f3fb40e65eededc52461822ec5","bugs":{"url":"https://github.com/c4milo/node-inotify/issues"},"homepage":"https://github.com/c4milo/node-inotify#readme","_id":"inotify@1.4.1","_shasum":"8abdeb7ee9cbc291542a252df00d848b2a8f9287","_from":"inotify@>= 0.1.6","_npmVersion":"3.8.6","_nodeVersion":"5.11.0","_npmUser":{"name":"c4milo","email":"camilo.aguilar@gmail.com"},"maintainers":[{"name":"camilo","email":"camilo@cloudescape.com"},{"name":"c4milo","email":"camilo.aguilar@gmail.com"}],"dist":{"shasum":"8abdeb7ee9cbc291542a252df00d848b2a8f9287","tarball":"https://registry.npmjs.org/inotify/-/inotify-1.4.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/inotify-1.4.1.tgz_1462444544613_0.7660284182056785"},"directories":{},"_resolved":"https://registry.npmjs.org/inotify/-/inotify-1.4.1.tgz","_requested":{"raw":"inotify@>= 0.1.6","scope":null,"name":"inotify","rawSpec":">= 0.1.6","spec":">=0.1.6","type":"range"},"_spec":"inotify@>= 0.1.6","_where":"/Users/elaine/proj1/node_modules/dev","_args":[[{"raw":"inotify@>= 0.1.6","scope":null,"name":"inotify","rawSpec":">= 0.1.6","spec":">=0.1.6","type":"range"},"/Users/elaine/proj1/node_modules/dev"]],"readme":"ERROR: No README data found!"} (current: {"os":"darwin","cpu":"x64"})
84 verbose stack at checkPlatform (/usr/local/lib/node_modules/npm/node_modules/npm-install-checks/index.js:45:14)
84 verbose stack at thenWarnEngineIssues (/usr/local/lib/node_modules/npm/lib/install/validate-args.js:41:5)
84 verbose stack at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
84 verbose stack at checkEngine (/usr/local/lib/node_modules/npm/node_modules/npm-install-checks/index.js:24:10)
84 verbose stack at module.exports.isInstallable (/usr/local/lib/node_modules/npm/lib/install/validate-args.js:38:3)
84 verbose stack at resolveWithNewModule (/usr/local/lib/node_modules/npm/lib/install/deps.js:497:12)
84 verbose stack at /usr/local/lib/node_modules/npm/lib/install/deps.js:491:7
84 verbose stack at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
84 verbose stack at /usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
84 verbose stack at addRequestedAndFinish (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:67:5)
85 verbose pkgid inotify@1.4.1
86 verbose cwd /Users/elaine/proj1
87 error Darwin 15.6.0
88 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
89 error node v6.2.2
90 error npm v3.9.5
91 error code EBADPLATFORM
92 error notsup Not compatible with your operating system or architecture: inotify@1.4.1
93 error notsup Valid OS: linux
93 error notsup Valid Arch: any
93 error notsup Actual OS: darwin
93 error notsup Actual Arch: x64
94 verbose exit [ 1, true ]
这是package.json
{
"name": "arthan",
"version": "0.0.0",
"main": "server/index.js",
"dependencies": {
"angular": "~1.6.0",
"angular-animate": "~1.6.0",
"angular-aria": "~1.6.0",
"angular-cookies": "~1.6.0",
"angular-google-places-autocomplete": "^0.2.9",
"angular-google-places-map": "^1.2.1",
"angular-material": "^1.1.4",
"angular-messages": "^1.6.4",
"angular-resource": "~1.6.0",
"angular-sanitize": "~1.6.0",
"angular-ui-bootstrap": "^2.0.1",
"angular-ui-router": "~0.3.1",
"angular-validation-match": "^1.9.0",
"aws-sdk": "^2.56.0",
"babel-polyfill": "^6.7.2",
"babel-runtime": "^6.6.1",
"blob-stream": "^0.1.3",
"bluebird": "^3.3.3",
"body-parser": "^1.13.3",
"bootstrap": "~3.3.7",
"bootstrap-social": "^5.0.0",
"composable-middleware": "^0.3.0",
"connect-mongo": "^1.2.1",
"cookie-parser": "^1.3.5",
"core-js": "^2.2.1",
"csvtojson": "^1.1.7",
"dev": "^0.1.3",
"ejs": "^2.5.3",
"errorhandler": "^1.4.2",
"express": "^4.13.3",
"express-jwt": "^5.0.0",
"express-session": "^1.11.3",
"fast-json-patch": "^1.0.0",
"font-awesome": ">=4.1.0",
"imagemin-svgo": "^5.2.2",
"install": "^0.10.1",
"jquery": "^3.2.1",
"jquery-locationpicker": "^0.1.12",
"jsonwebtoken": "^7.0.0",
"lodash": "^4.7.0",
"lusca": "^1.3.0",
"method-override": "^2.3.5",
"mongoose": "^4.7.3",
"morgan": "~1.7.0",
"multer": "^1.3.0",
"node-pre-gyp": "^0.6.36",
"notp": "^2.0.3",
"passport": "~0.3.0",
"passport-facebook": "^2.0.0",
"passport-google-oauth20": "^1.0.0",
"passport-local": "^1.0.0",
"pdfkit": "^0.8.2",
"promise-waterfall": "^0.1.0",
"serve-favicon": "^2.3.0",
"shrink-ray": "^0.1.3",
"sprint-js": "~0.1.0",
"thirty-two": "^1.0.2",
"uuid": "^3.0.1"
},
"devDependencies": {
"angular-mocks": "~1.6.0",
"autoprefixer": "^6.0.0",
"awesome-typescript-loader": "^1.1.1",
"babel-cli": "^6.24.1",
"babel-core": "^6.6.5",
"babel-eslint": "^6.0.4",
"babel-loader": "^6.2.4",
"babel-plugin-syntax-flow": "^6.8.0",
"babel-plugin-transform-class-properties": "^6.6.0",
"babel-plugin-transform-flow-comments": "^6.8.0",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-env": "^1.5.1",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.6.5",
"browser-sync": "^2.8.0",
"bs-fullscreen-message": "^1.0.0",
"chai": "^3.2.0",
"chai-as-promised": "^5.1.0",
"chai-things": "^0.2.0",
"css-loader": "^0.24.0",
"del": "^2.0.2",
"eslint": "^2.12.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"flow-bin": "^0.31.0",
"grunt": "^1.0.1",
"grunt-build-control": "^0.7.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-env": "^0.4.0",
"gulp-eslint": "^2.0.0",
"gulp-imagemin": "^3.0.1",
"gulp-inject": "^4.0.0",
"gulp-istanbul": "^1.1.1",
"gulp-istanbul-enforcer": "^1.0.3",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-mocha": "^2.1.3",
"gulp-node-inspector": "^0.1.0",
"gulp-plumber": "^1.0.1",
"gulp-protractor": "^3.0.0",
"gulp-rev": "^7.0.0",
"gulp-rev-replace": "^0.4.2",
"gulp-sort": "^2.0.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-stylint": "^3.0.0",
"gulp-util": "^3.0.5",
"gulp-watch": "^4.3.5",
"html-webpack-harddisk-plugin": "~0.0.2",
"html-webpack-plugin": "^2.16.0",
"imports-loader": "^0.6.5",
"isparta": "^4.0.0",
"isparta-instrumenter-loader": "^1.0.0",
"isparta-loader": "^2.0.0",
"istanbul": "1.1.0-alpha.1",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "^2.3.4",
"jasmine-spec-reporter": "^2.4.0",
"karma": "~0.13.3",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "~1.0.0",
"karma-script-launcher": "^1.0.0",
"karma-sourcemap-loader": "~0.3.7",
"karma-spec-reporter": "~0.0.20",
"karma-webpack": "^1.7.0",
"lazypipe": "^1.0.1",
"mocha": "^3.0.2",
"ng-annotate-loader": "~0.1.0",
"nodemon": "^1.3.7",
"null-loader": "^0.1.1",
"open": "~0.0.4",
"phantomjs-prebuilt": "^2.1.4",
"postcss-loader": "^0.11.1",
"proxyquire": "^1.0.1",
"raw-loader": "^0.5.1",
"run-sequence": "^1.1.0",
"sinon": "^1.16.1",
"sinon-chai": "^2.8.0",
"strip-ansi": "^3.0.1",
"style-loader": "^0.13.0",
"supertest": "^1.1.0",
"through2": "^2.0.1",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.5.1",
"webpack-stream": "^3.2.0"
},
"engines": {
"node": "^6.2.2",
"npm": "^3.9.5"
},
"scripts": {
"test": "gulp test",
"flow": "flow",
"update-webdriver": "node node_modules/protractor/bin/webdriver-manager update",
"start": "node server"
},
"private": true
}
答案 0 :(得分:5)
问题可能是由(已弃用的)dev
程序包引起的,该程序包直接依赖于inotify
,这是一个仅限Linux的程序包,因此它无法在macOS上运行。
如果您实际上不依赖于包裹,则可以将其删除(npm uninstall dev --save
)。
否则,您应该将其替换为跨平台替代方案。 dev
的开发人员建议using nodemon
。
答案 1 :(得分:2)
由于 dev 包而产生此问题, 它直接依赖于inotify(仅限Linux)包
使用此命令删除此软件包 - npm uninstall dev --save
答案 2 :(得分:0)
sudo npm install -g eslint 这里我们需要使用sudo进行身份验证