Skip to content

fsevents dependency prevents installation #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ranjitjhala opened this issue Sep 18, 2015 · 28 comments
Closed

fsevents dependency prevents installation #583

ranjitjhala opened this issue Sep 18, 2015 · 28 comments
Labels

Comments

@ranjitjhala
Copy link

Hi @basarat,

I just re-installed atom (on mac os) no other packages, and then tried to install atom-typescript.

I get this error:

Some installed packages could not be loaded because they contain native modules that were compiled for an earlier version of Atom

In more detail

In file included from ../fsevents.cc:6:
In file included from ../node_modules/nan/nan.h:74:
In file included from ../node_modules/nan/nan_new.h:181:
../node_modules/nan/nan_implementation_12_inl.h:172:66: error: too many arguments to function call, expected at most 2, have 4
  return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
         ~~~~~~~~~~~~~~~~~~                                      ^~~~~~~~~~
/Users/rjhala/.atom/.node-gyp/.node-gyp/0.30.6/deps/v8/include/v8.h:4515:3: note: 'New' declared here
  static Local<Signature> New(
  ^
1 error generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rjhala/.atom/packages/atom-typescript/node_modules/grunt-ts/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.30
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 

npm ERR! Darwin 14.5.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/rjhala/.atom/.apm/.apmrc" "--userconfig" "/Users/rjhala/.atom/.apmrc" "rebuild" "--target=0.30.6" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE
npm ERR! fsevents@0.3.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fsevents@0.3.5 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls fsevents
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rjhala/.atom/packages/atom-typescript/npm-debug.log

And here is the content of the npm-debug.log:

https://gist.github.com/ranjitjhala/1259a624309004498adc

Please let me know if I can provide any other information.

Could it be that I have a "stale" fsevents on my machine?

Shall I wipe the npm database or some such?

@ranjitjhala
Copy link
Author

I recently upgraded to Yosemite, I notice this:

fsevents/fsevents#56

Could it be a related issue?

@basarat
Copy link
Member

basarat commented Sep 18, 2015

Going through the log : https://gist.github.com/ranjitjhala/1259a624309004498adc#file-atom-typescript-error-L5859-L5870 It seems that its falling over installing grunt-ts which depends on chokidar which depends on fsevents.

The concern is that we only have grunt-ts as a dev dependency (code here) ... and don't expect it to be installed on apm install atom-typescript. Is apm install atom-typescript the command you ran?

@msurdi
Copy link

msurdi commented Sep 18, 2015

Same error here, just after installing an Atom update, I got a warning about atom-typescript requiring a rebuild. A few seconds after clicking "rebuild" I get the same error.

@msurdi
Copy link

msurdi commented Sep 18, 2015

Looking at the Atom changelog for 1.0.12:

Atom now ships with Chrome 43 and io.js 2.3.1.

@basarat
Copy link
Member

basarat commented Sep 18, 2015

@msurdi / @ranjitjhala can you follow dev machine workflow : https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md#setup-dev-machine to rule out something atom specific crashing the whole workflow. Basically I am curious about manual npm install results 🌹

@msurdi
Copy link

msurdi commented Sep 18, 2015

@basarat Following the dev setup instructions works fine. To me, it seems that Atom is using its own node version when doing the "rebuild" and not the system wide node I have on my computer. But I don't really now anything about the internals of Atom, so I'm just guessing.

@msurdi
Copy link

msurdi commented Sep 18, 2015

So, even after manual installation, Atom still complains about the plugin needing a rebuild, and fails again.

@ranjitjhala
Copy link
Author

@basarat I can confirm what @msurdi says -- same thing happens on the dev workflow.

(In addition to the above) I tried installing from within atom -- i.e. by clicking on the install button and by doing apm install atom-typescript. In both cases the install succeeds until I open a .ts file, in which case the little bug appears on the bottom right, clicking which leads to the above (and the screenshot on #584).

@Sprechen
Copy link

I have the same problem. It seems that with fsevent@1.0.0 this problem can be resolved (webpack/webpack#1435)

@sebilasse
Copy link

same here. Package stopped working after updating atom.

@sebilasse
Copy link

@Sprechen
Hm - still the same

npm ERR! fsevents@1.0.0 install: node-pre-gyp install --fallback-to-build

@brandom
Copy link

brandom commented Sep 18, 2015

I resolved this issue by navigating to .atom/packages/atom-typescript
rm -rf node_modules
npm install
and then rebuilding in atom.

@ranjitjhala
Copy link
Author

Hooray! I can confirm that @brandom 's method works for me too! Thanks!

@isuda
Copy link

isuda commented Sep 18, 2015

It did not work for me. Instead, I got it working by doing the following:

in .atom/packages/atom-typescript:

  • remove grunt-ts from devDependencies in package.json (note this will break stuff if you are trying to develop atom-typescript)
  • rm -rf node_modules
  • npm install
  • rebuild in atom.

Edit: added back npm install step.

@sebilasse
Copy link

@isuda did rebuild also do npm install for you ?
I had to do npm install in the end... however 👍

@psnider
Copy link

psnider commented Sep 18, 2015

This is failing for me too, with:

  • atom typescript v6.0.10
  • atom 1.0.13
  • OSX Yosemite 10.10.5

But I also tried making edits that break my build, and atom-typescript doesn't indicate there's any problems, while tsc shows them. So atom-typescript is not working anymore.

I've tried each of the suggestions here, but none have worked.
It seems that there is some difference between the way the fsevents package is being built by atom and the way it is built from the command line. When I exited atom, and ran the following commands:

cd ~/.atom/packages/atom-typescript/node_modules/babel/node_modules/chokidar
npm uninstall fsevents
sed -i .tmp 's/"fsevents": "^0.3.8"/"fsevents": "^1.0.0"/g' package.json
npm install fsevents

the build during install produces this output that seems clean:

> fsevents@1.0.0 install /Users/peter/.atom/packages/atom-typescript/node_modules/babel/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/peter/.atom/packages/atom-typescript/node_modules/babel/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v14-darwin-x64/fse.node" is installed via remote
fsevents@1.0.0 node_modules/fsevents
└── nan@2.0.9

But when I restart atom, the red bug symbol is still there, and clicking it, then rebuild packages produces a similar error as before, but with these lines:

npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fsevents@1.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the fsevents@1.0.0 install script 'node-pre-gyp install --fallback-to-build'.

Note that it's complaining about the same node-pre-gyp install --fallback-to-build command that worked from the shell!

@dcsan
Copy link

dcsan commented Sep 18, 2015

getting this too

image

@sebilasse
Copy link

@psnider did you remove grunt-ts from package.json and did you remove all node_modules ?
For me it was not caused by babel but by fsevents in grunt-ts ...
And @dcsan : Did you try the isuda fix with 6.1.0 (6.0.5 above) ?

@psnider
Copy link

psnider commented Sep 18, 2015

Got it!

@sebilasse And, yes, I had removed grunt-ts from the top level, and also had removed all of the node_modules. Thanks.

I have node installed in /usr/local/bin, which is on my PATH.
However, I noticed in the log that node-gyp couldn't find node.

So I added echo "node-gyp: env=env" 1>&2 to /Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/node-gyp-bin/node-gyp
and my PATH variable's settings didn't appear in those listed.
So I created a symlink to node from /usr/bin,
and rebuilt from the Incompatible Packages tab in atom.
Now atom-typescript works again.

For those interested, the PATH that was passed to node-gyp contained these locations:

/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/node-gyp-bin:
/Users/peter/.atom/packages/atom-typescript/node_modules/babel/node_modules/chokidar/node_modules/fsevents/node_modules/.bin:
/Users/peter/.atom/packages/atom-typescript/node_modules/babel/node_modules/chokidar/node_modules/.bin:
/Users/peter/.atom/packages/atom-typescript/node_modules/babel/node_modules/.bin:
/Users/peter/.atom/packages/atom-typescript/node_modules/.bin:
/usr/bin:
/bin:/usr/sbin:
/sbin

@isuda
Copy link

isuda commented Sep 18, 2015

@psnider: I also got this error. Launching atom from the command line, and then clicking "rebuild" fixed this for me.

@Sprechen
Copy link

@isuda: Also for me launching atom from command line and then clicking "rebuild" has worked!

@sgal
Copy link
Contributor

sgal commented Sep 18, 2015

@isuda Thanks, that worked for me also! Very strange why though...

@psnider
Copy link

psnider commented Sep 18, 2015

It appears that Macs don't read your shell's configuration file when
launching an application by clicking an icon, such as from your Application
Dock or from Finder.
When you do start it from your shell's command line, I believe the
environment variables are set.

I have to find a solution to this that I like...

On Fri, Sep 18, 2015 at 9:47 PM, Sergey Galchenko notifications@github.com
wrote:

@isuda https://github.com/isuda Thanks, that worked for me also! Very
strange why though...


Reply to this email directly or view it on GitHub
#583 (comment)
.

@basarat
Copy link
Member

basarat commented Sep 18, 2015

I've just published 6.0.11 without grunt-ts as a quick workaround.

Will keep this issue till I document the dev setup in CONTRIBUTING or figure out an alternative workaround.

At least you guys will have this version to manually install on latest atom if I break something again by trying to reintroduce grunt-ts 🌹 I'll make it a major version upgrade.

@lucaguada
Copy link

in my case (but I dunno if it's related) the last build keep sending requests (http-req? I'm not able to understand it, but they are very slow) everytime I write some code! at the right of Typescript toolbar appears a Github spinning icon (???) and by clicking on it an info notification pops up with the title "Pending requests" where I read messages such as:

  • getProjectFilesDetails
  • editText
  • errorsForFile
  • etc...

how to disable it? :\

@basarat
Copy link
Member

basarat commented Sep 19, 2015

@Tryio these are requests send to a background process that is actually doing the heavy lifting of code analysis.

getProjectFilesDetails

@Tryio Seems related to : #332 see workaround : #332 (comment)

@basarat
Copy link
Member

basarat commented Sep 19, 2015

Since a lot of people experienced this. I am marking this as closed with 6.0.12 🌹 (also had to remove grunt dependency for windows users)

@rcchen
Copy link

rcchen commented Sep 21, 2015

For what it's worth, it looks like there was a bug on Atom's end for rebuilding native modules (see atom/atom#8837) that is resolved in 1.0.15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests