execSync icon indicating copy to clipboard operation
execSync copied to clipboard

Cannot find module './build/Release/shell'

Open olanod opened this issue 9 years ago • 27 comments

After installing with npm install execSync I got Cannot find module './build/Release/shell' error.
I had to go into the node_modules directory and build it myself passing the flag --python python2 to the node-gyp rebuild command.

olanod avatar Sep 26 '14 04:09 olanod

I have the same problem!

The problem is that your system doesn't make the build:

[execsync v1.0.2] Attempting to compile native extensions.
[execSync v1.0.2]
    Native code compile failed!!

In my case the problem appear today, yesterday all worked fine and the repository hasn't been updated. ¿?

Kikobeats avatar Oct 01 '14 08:10 Kikobeats

Hi,

In my case:

  • download the proyect
  • do node-gyp rebuild
  • see the message error :)
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

damm!

Kikobeats avatar Oct 01 '14 09:10 Kikobeats

I had same problem than @olanod. Solved by simple 'node-gyp rebuild'

bdavidxyz avatar Oct 10 '14 15:10 bdavidxyz

We hit this too. There was no way we could fix. Running node-gyp did not fix the problem.

n8agrin avatar Oct 27 '14 20:10 n8agrin

Also affects me

mrfelton avatar Nov 26 '14 02:11 mrfelton

Digging a little on the net I've found that this is affecting only guys that are using Python 3.x as their default python executable ( see https://github.com/TooTallNate/node-gyp/issues/526 and https://github.com/atom/atom/issues/1933 ). To fix this issue ( call it a workaround) you should do this on the project you're having this issue:

npm config set python /usr/bin/python2.7
npm install

Make sure that you're having Python 2 installed as a package in your distro ( my solution is based on Ubuntu 14.10 ).

Have fun :)

julianxhokaxhiu avatar Nov 28 '14 12:11 julianxhokaxhiu

@julianxhokaxhiu unfortunately, this doesn't solved my problem.

Besides that, the most annoying thing about that bug is that it appears out of a sudden. Yesterday everything worked perfectly. Can everyone come up with an idea for an explanation?

scheffield avatar Jan 09 '15 10:01 scheffield

@scheffield are you sure? For me it worked also two days ago on Arch Linux where I did my new dev server (same error, same fix and now working awesome).

Try to remove your node_modules folder after you set the npm config for python :) Finally make sure (obviously) that python 2 is installed and running on your machine...

julianxhokaxhiu avatar Jan 10 '15 16:01 julianxhokaxhiu

We resolved this a short time ago. Turned out my coworker who was hitting this problem had a rogue, custom build of make in his path. Sorry for the confusion.

n8agrin avatar Jan 12 '15 19:01 n8agrin

Also getting this issue, and I'm running Python 2.7.6.

Running node-gyp rebuild doesn't work for me (command not found).

This also did not fix the issue:

npm config set python /usr/bin/python2.7
npm install

cperryk avatar Feb 03 '15 21:02 cperryk

Also running in this issue. I have tried all of the suggestions above and still no luck. Any other suggestions? Much appreciated.

ccgroupdev avatar Feb 10 '15 06:02 ccgroupdev

I am facing the same issue. Tried the above suggestions but of no help. I am using OSX 10.9.4. Need help urgently. That will be much appreciated.

sabreena avatar Feb 18 '15 14:02 sabreena

I would suggest to use exec-sync from now on, compatible with nodejs 0.12.x and anyway it doesn't depend on libc, python or stuff like this :)

julianxhokaxhiu avatar Feb 18 '15 15:02 julianxhokaxhiu

I am still getting the same error even after using sudo npm install exec-sync The error is: events.js:72 throw er; // Unhandled 'error' event ^ Error: Cannot find module './build/Release/shell' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/Users/sabreena/.nvm/v0.10.24/lib/node_modules/generator-drupal-theme/node_modules/execSync/index.js:30:11) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

Any other solution to it?

sabreena avatar Feb 19 '15 11:02 sabreena

Clean reinstall NPM and remove all node_modules folders. Then just run again npm install :)

julianxhokaxhiu avatar Feb 19 '15 12:02 julianxhokaxhiu

No solution works.

webpolis avatar Mar 22 '15 14:03 webpolis

No solution works to me too

megatolya avatar Mar 22 '15 18:03 megatolya

No solution here either.

sgarbesi avatar Mar 23 '15 21:03 sgarbesi

Only solution is switching to https://www.npmjs.com/package/exec-sync

webpolis avatar Mar 23 '15 21:03 webpolis

@webpolis Using a 3rd party library, grunt-favicons otherwise I would. Still looking, let you know if I find anything.

sgarbesi avatar Mar 23 '15 22:03 sgarbesi

@webpolis Wound up just forking and updating manually.

sgarbesi avatar Mar 23 '15 22:03 sgarbesi

These are some alternatives:

  • Native for: >v0.12 https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options
  • https://github.com/arturadib/shelljs

luishdez avatar Mar 31 '15 18:03 luishdez

It may be worth noting that you can have issues using node v0.12 instead of v0.10 for example, try downgrading it using nvm.

cphyc avatar May 19 '15 12:05 cphyc

Easily solved on a Mac: run sudo make to cause Xcode to prompt you to agree to the license terms, then run npm install execSync again.

aclowes avatar Nov 10 '15 17:11 aclowes

@aclowes' solution worked for me. Thanks pal! :+1:

fmquaglia avatar Feb 05 '16 05:02 fmquaglia

@aclowes thanks, that worked for us.

rvergis avatar Feb 05 '16 13:02 rvergis

Time to close this @mgutz ?

julianxhokaxhiu avatar Sep 16 '18 14:09 julianxhokaxhiu