spiffcode / ghedit

A fast, powerful web-based code editor for GitHub repositories
https://spiffcode.github.io/ghedit/
MIT License
341 stars 49 forks source link

build error on ubuntu #19

Open zhangpy opened 7 years ago

zhangpy commented 7 years ago

when I run ./script/npm.sh install, I got this log

59027 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    win32
59027 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
59027 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
59027 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
59028 verbose stack Error: Unsupported platform for fsevents@0.3.8: wanted {"name":"fsevents","version":"0.3.8","description":"Native Access to Mac OS-X FSEvents","main":"fsevents.js","dependencies":{"nan":"^2.0.2"},"os":["darwin"],"engines":{"node":">=0.8.0"},"scripts":{"test":"tap ./test","install":"node-gyp rebuild"},"repository":{"type":"git","url":"git+https://github.com/strongloop/fsevents.git"},"keywords":["fsevents","mac"],"author":{"name":"Philipp Dunkel","email":"pip@pipobscure.com"},"license":"MIT","bugs":{"url":"https://github.com/strongloop/fsevents/issues"},"homepage":"https://github.com/strongloop/fsevents","devDependencies":{"tap":"~0.4.8"},"gypfile":true,"readme":"# FSEvents [![NPM](https://nodei.co/npm/fsevents.png)](https://nodei.co/npm/fsevents/)\n## Native Access to Mac OS-X FSEvents\n\n * [Node.js](http://nodejs.org/)\n * [Github repo](https://github.com/strongloop/fsevents.git)\n * [Module Site](https://github.com/strongloop/fsevents)\n * [NPM Page](https://npmjs.org/package/fsevents)\n\n## Installation\n\n\t$ npm install -g node-gyp\n\t$\tgit clone https://github.com/strongloop/fsevents.git fsevents\n\t$ cd fsevents\n\t$ node-gyp configure build\n\nOR SIMPLY\n\n\t$ npm install fsevents\n\n## Usage\n\n```js\nvar fsevents = require('fsevents');\nvar watcher = fsevents(__dirname);\nwatcher.on('fsevent', function(path, flags, id) { }); // RAW Event as emitted by OS-X\nwatcher.on('change', function(path, info) {}); // Common Event for all changes\nwatcher.start() // To start observation\nwatcher.stop()  // To end observation\n```\n\n### Events\n\n * *fsevent* - RAW Event as emitted by OS-X\n * *change* - Common Event for all changes\n * *created* - A File-System-Item has been created\n * *deleted* - A File-System-Item has been deleted\n * *modified* - A File-System-Item has been modified\n * *moved-out* - A File-System-Item has been moved away from this location\n * *moved-in* - A File-System-Item has been moved into this location\n\nAll events except *fsevent* take an *info* object as the second parameter of the callback. The structure of this object is:\n\n```js\n{\n  \"event\": \"<event-type>\",\n  \"id\": <eventi-id>,\n  \"path\": \"<path-that-this-is-about>\",\n  \"type\": \"<file|directory|symlink>\",\n  \"changes\": {\n    \"inode\": true, // Has the iNode Meta-Information changed\n    \"finder\": false, // Has the Finder Meta-Data changed\n    \"access\": false, // Have the access permissions changed\n    \"xattrs\": false // Have the xAttributes changed\n  },\n  \"flags\": <raw-flags>\n}\n```\n\n## MIT License\n\nCopyright (C) 2010-2014 Philipp Dunkel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"Readme.md","_id":"fsevents@0.3.8","_shasum":"9992f1032c925c829554d0d59801dca0313a5356","_resolved":"https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","_from":"fsevents@>=0.3.1 <0.4.0","_inCache":true,"_requested":{"raw":"fsevents@https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","scope":null,"escapedName":"fsevents","name":"fsevents","rawSpec":"https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","spec":"https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","type":"remote"},"_spec":"fsevents@https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","_where":"/home/zhangpy/Projects/demo/ghedit","_args":[[{"raw":"fsevents@https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","scope":null,"escapedName":"fsevents","name":"fsevents","rawSpec":"https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","spec":"https://registry.npmjs.org/fsevents/-/fsevents-0.3.8.tgz","type":"remote"},"/home/zhangpy/Projects/demo/ghedit"]],"_shrinkwrap":null,"optionalDependencies":{}} (current: {"os":"linux","cpu":"x64"})
59028 verbose stack     at checkPlatform (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/node_modules/npm-install-checks/index.js:45:14)
59028 verbose stack     at thenWarnEngineIssues (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/lib/install/validate-args.js:41:5)
59028 verbose stack     at ~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/node_modules/iferr/index.js:13:50
59028 verbose stack     at checkEngine (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/node_modules/npm-install-checks/index.js:24:10)
59028 verbose stack     at module.exports.isInstallable (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/lib/install/validate-args.js:38:3)
59028 verbose stack     at actions.(anonymous function) (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/lib/install/actions.js:51:14)
59028 verbose stack     at execAction (~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/lib/install/actions.js:111:7)
59028 verbose stack     at ~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
59028 verbose stack     at Array.forEach (native)
59028 verbose stack     at ~/.nvm/versions/node/v7.10.0/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
59029 verbose pkgid fsevents@0.3.8
59030 verbose cwd ~/Projects/demo/ghedit
59031 error Linux 4.4.0-78-generic
59032 error argv "~/.nvm/versions/node/v7.10.0/bin/node" "~/.nvm/versions/node/v7.10.0/bin/npm" "install"
59033 error node v7.10.0
59034 error npm  v4.2.0
59035 error code EBADPLATFORM
59036 error notsup Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
59037 error notsup Valid OS:    darwin
59037 error notsup Valid Arch:  any
59037 error notsup Actual OS:   linux
59037 error notsup Actual Arch: x64
59038 verbose exit [ 1, true ]
bohdantrotsenko commented 7 years ago

so, I'm on Ubuntu 17.04 I first tried installing npm with apt, but running ./script/npm.sh install gave a hint that my node is old. I installed v8 as in this answer: https://askubuntu.com/a/711976/7745

what I also had to do besides the steps in readme: $ sudo apt-get install libx11-dev I got it when the npm.sh install suggested I had x11.h missing. Running npm.sh install again actually yielded the error fsevents@0.3.8: wanted {"os":"darwin"... After some googling I cleaned the repo completely to start anew:

git reset --hard
git clea -xfd

And, surprisingly, fsevents error didn't show up this time. I also had to install

$ sudo npm install -g gulp
$ sudo npm install -g typescript

These are required at npm run build step. And before running npm run build be sure to run npm install (from the ghedit subfolder) or you'll have strange monaco-related errors.