arboleya / electrify

Package your Meteor apps with Electron, and butter
MIT License
247 stars 52 forks source link

Error: Cannot find module .electrify/node_modules/electron-prebuilt/package.json #3

Closed ramonitor closed 9 years ago

ramonitor commented 9 years ago

Hi,

I'm getting the following error after giving the command 'electrify'. I tested on Windows and a Mac with the leaderboard sample application. I checked, there is no 'electron-prebuilt' in the node_modules folder (only a .bin and shelljs folder).

Error: Cannot find module '/Users/dev/Documents/Dev/d/leaderboard/.electrify/node_modules/electron-prebuilt/package.json' 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 Npm.require (/Users/dev/Documents/Dev/d/leaderboard/.meteor/local/build/programs/server/boot.js:142:18) at package_app (packages/arboleya:electrify/index.meteor.js:317:1) at release (packages/arboleya:electrify/index.meteor.js:167:1) at repl:1:2 at /Users/dev/Documents/Dev/d/leaderboard/.meteor/local/build/programs/server/shell-server.js:243:23

arboleya commented 9 years ago

Have you executed the electrify command from npm module or from inside meteor shell?

Also, can you please post the full log output, and not just the error?

I did this test here, and it worked.

$ meteor create --example leaderboard && cd leaderboard && meteor add arboleya:electrify && npm install -g electrify && electrify

Output:

leaderboard: created.

To run your new app:
  cd leaderboard
  meteor

Changes to your project's package version selections:

arboleya:electrify  added, version 1.1.0

arboleya:electrify: Package your Meteor apps with Electron, and butter.
/usr/local/opt/nvm/versions/node/v0.12.2/bin/electrify -> /usr/local/opt/nvm/versions/node/v0.12.2/lib/node_modules/electrify/electrify
electrify@1.1.0 /usr/local/opt/nvm/versions/node/v0.12.2/lib/node_modules/electrify
└── shelljs@0.5.1

electrify:  setting up folders
electrify:  copying template files
electrify:  copying mongo and node binaries
electrify:  bundling meteor
electrify:  installing meteor dependencies
electrify:  installing electrified dependencies
electrify:  packaging app for platform darwin x64 using electron v0.29.2
electrify:  wrote new app to  /Users/anderson/Desktop/leaderboard/.electrify/.dist
ramonitor commented 9 years ago

I tried running the same command, here's the output:

sudo meteor create --example leaderboard && cd leaderboard && meteor add arboleya:electrify && npm install -g electrify && electrify leaderboard: created.

To run your new app: cd leaderboard meteor

/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:278 throw(ex); ^ Error: EACCES, open '/Users/dev/Documents/Dev/leaderboard/.meteor/.packages.1js5ys9' at Object.Future.wait (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:398:15) at Object.wrapper as writeFile at Object.files.writeFileAtomically (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/files.js:829:9) at [object Object]..extend._write (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/project-context.js:829:11) at [object Object]..extend.writeIfModified (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/project-context.js:813:28) at ProjectContext..extend._saveChangedMetadata (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/project-context.js:708:35) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/project-context.js:238:35 at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:352:18 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:345:34 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:343:23 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at Object.enterJob (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:317:26) at ProjectContext..extend._completeStagesThrough (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/project-context.js:228:18) at ProjectContext..extend.saveChangedMetadata (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/project-context.js:216:10) at ProjectContext..extend.prepareProjectForBuild (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/project-context.js:221:10) at /Users/rhansman/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/commands-packages.js:1878:20 at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:264:13 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:257:29 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:255:18 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x8664/tools/buildmessage.js:246:23 at [object Object]..extend.withValue (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14) at Object.capture (/Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:245:19) at Command.main.registerCommand.name as func at /Users/dev/.meteor/packages/meteor-tool/.1.1.4.jmk3io++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/main.js:1363:23


arboleya commented 9 years ago

This is another problem, and has nothing to do with Electrify or your first issue.

You ran the meteor create command with sudo, so I suspect the command meteor add arboleya:electrify should be run with sudo as well?

ramonitor commented 9 years ago

Hi, I tried creating a new leaderboard sample and added arboleya:electrify with sudo and also started meteor shell with sudo, but still the same issue (Error: Cannot find module '/Users/dev/Documents/Dev/leaderboard/.electrify/node_modules/electron-prebuilt/package.json'). The strange thing is I get exactly the same error on a totally different system running Windows 10.

arboleya commented 9 years ago

Can you send the full log for this error?

Basically, I want to understand between which of these step the error comes in:

electrify:  setting up folders
electrify:  copying template files
electrify:  copying mongo and node binaries
electrify:  bundling meteor
electrify:  installing meteor dependencies
electrify:  installing electrified dependencies
electrify:  packaging app for platform darwin x64 using electron v0.29.2
electrify:  wrote new app to  /Users/anderson/Desktop/leaderboard/.electrify/.dist
arboleya commented 9 years ago

Also, I've just ran the same commands I sent you in Win, Linux and Osx. And no errors for me.

ramonitor commented 9 years ago

I'm having trouble finding the full log that you would like to see. Where can I find it?

I've noticed I also get an error in the console after running the app with electrify installed. After removing the electrify package, the error disappears.

Started proxy. => Started MongoDB. I20150815-10:32:35.182(2)? electrify: installing electrified dependencies I20150815-10:32:38.422(2)? electrify: launching electron W20150815-10:32:38.431(2)? (STDERR) W20150815-10:32:38.432(2)? (STDERR) events.js:72 W20150815-10:32:38.432(2)? (STDERR) throw er; // Unhandled 'error' event W20150815-10:32:38.432(2)? (STDERR) ^ W20150815-10:32:38.434(2)? (STDERR) Error: spawn ENOENT W20150815-10:32:38.434(2)? (STDERR) at errnoException (child_process.js:1011:11) W20150815-10:32:38.434(2)? (STDERR) at Process.ChildProcess._handle.onexit (child_process.js:802:34) => Exited with code: 8 => Meteor server restarted => Started your app.

=> App running at: http://localhost:3000/

arboleya commented 9 years ago

This is so weird, can't imagine why electron is not being correctly installed inside .electrify folder.

Pls tell me:

1) Is there a package.json file inside the .electrify folder?

2) If you run npm install inside the .electrify folder, and then try to run meteor again, back in the project root folder, does it works?

ramonitor commented 9 years ago

I spent some time on this issue tonight and I'm getting somewhere. Appareantly you need the electron-prebuilt node package as well (might be basic knowledge, but I'm new to node/npm so did not know) and the electrifying is no longer giving errors. :)

The only thing that is not yet working, is actually running the electrified app. I got an error about shelljs/global missing. I installed the shelljs globally but that does not resolve the issue yet.

arboleya commented 9 years ago

Please, run this command inside your terminal (in osx) and send me the complete output:

mkdir temp && cd temp && git clone git://github.com/arboleya/electrify && cd electrify && npm install && cd ..  && meteor create --example leaderboard && mkdir leaderboard/packages && ln -s `pwd`/electrify `pwd`/leaderboard/packages/arboleya-electrify && cd leaderboard && meteor add arboleya:electrify && BUTTER=true meteor

The complete output should be something like this - though in your case it'll probably have errors:

➜ mkdir temp && cd temp && git clone git://github.com/arboleya/electrify && cd electrify && npm install && cd ..  && meteor create --example leaderboard && mkdir leaderboard/packages && ln -s `pwd`/electrify `pwd`/leaderboard/packages/arboleya-electrify && cd leaderboard && meteor add arboleya:electrify && BUTTER=true meteor
Cloning into 'electrify'...
remote: Counting objects: 122, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 122 (delta 1), reused 0 (delta 0), pack-reused 115
Receiving objects: 100% (122/122), 23.70 KiB | 0 bytes/s, done.
Resolving deltas: 100% (65/65), done.
Checking connectivity... done.
npm WARN package.json electrify@1.1.0 No repository field.
shelljs@0.5.1 node_modules/shelljs

mversion@1.10.0 node_modules/mversion
├── minimist@0.2.0
├── semver@4.3.6
├── contra@1.9.1 (atoa@1.0.0, ticky@1.0.0)
├── rc@0.5.5 (strip-json-comments@0.1.3, ini@1.3.4, deep-extend@0.2.11, minimist@0.0.10)
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── minimatch@1.0.0 (sigmund@1.0.1, lru-cache@2.6.5)
├── through2@1.1.1 (xtend@4.0.0, readable-stream@1.1.13)
├── cli-usage@0.1.1 (marked@0.3.5, marked-terminal@0.1.0)
├── vinyl-fs@0.3.13 (graceful-fs@3.0.8, mkdirp@0.5.1, strip-bom@1.0.0, vinyl@0.4.6, defaults@1.0.2, through2@0.6.5, glob-stream@3.1.18, glob-watcher@0.0.6)
└── update-notifier@0.2.2 (is-npm@1.0.0, semver-diff@2.0.0, string-length@1.0.1, configstore@0.3.2, latest-version@1.0.1)

npm-check@3.2.10 node_modules/npm-check
├── semver-diff@2.0.0
├── giturl@0.0.3
├── text-table@0.2.0
├── q@1.4.1
├── semver@4.3.6
├── lodash@3.10.1
├── registry-url@3.0.3 (rc@1.1.0)
├── chalk@1.1.0 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, has-ansi@2.0.0, strip-ansi@3.0.0)
├── commander@2.8.1 (graceful-readlink@1.0.1)
├── npmconf@2.1.2 (uid-number@0.0.5, ini@1.3.4, inherits@2.0.1, mkdirp@0.5.1, once@1.3.2, config-chain@1.1.9, nopt@3.0.3, osenv@0.1.3)
├── globby@1.2.0 (object-assign@2.1.1, async@0.9.2, array-union@1.0.1, glob@4.5.3)
├── buffered-spawn@1.1.2 (err-code@0.1.2, cross-spawn-async@1.0.1)
├── inquirer@0.8.5 (figures@1.3.5, ansi-regex@1.1.1, cli-width@1.0.1, through@2.3.8, readline2@0.1.1, rx@2.5.3)
├── depcheck@0.4.7 (walkdir@0.0.7, optimist@0.6.1, minimatch@2.0.10, detective@4.1.1)
├── update-notifier@0.3.2 (is-npm@1.0.0, string-length@1.0.1, configstore@0.3.2, latest-version@1.0.1)
└── npm-registry-client@6.5.1 (chownr@0.0.2, slide@1.1.6, graceful-fs@3.0.8, retry@0.6.1, mkdirp@0.5.1, once@1.3.2, npm-package-arg@4.0.2, rimraf@2.4.2, concat-stream@1.5.0, normalize-package-data@2.3.1, npmlog@1.2.1, request@2.60.0)
leaderboard: created.

To run your new app:
  cd leaderboard
  meteor
arboleya:electrify: updating npm dependencies -- shelljs...

Changes to your project's package version selections:

arboleya:electrify  added, version 1.1.0

arboleya:electrify: Package your Meteor apps with Electron, and butter.
[[[[[ ~/Desktop/temp/leaderboard ]]]]]

=> Started proxy.
=> Started MongoDB.
I20150818-19:51:51.522(-3)? electrify:  setting up folders
I20150818-19:51:51.523(-3)? electrify:  copying template files
I20150818-19:51:51.523(-3)? electrify:  installing electrified dependencies
I20150818-19:51:51.925(-3)? npm WARN package.json Electrified@ No description
I20150818-19:51:51.926(-3)? npm WARN package.json Electrified@ No repository field.
I20150818-19:51:51.926(-3)? npm WARN package.json Electrified@ No README data
I20150818-19:51:51.932(-3)? npm WARN package.json electrify@1.1.0 No repository field.
I20150818-19:51:59.372(-3)? npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
I20150818-19:52:04.083(-3)?
I20150818-19:52:04.083(-3)? > electron-prebuilt@0.29.2 postinstall /Users/anderson/Desktop/temp/leaderboard/.electrify/node_modules/electron-prebuilt
I20150818-19:52:04.083(-3)? > node install.js
I20150818-19:52:04.083(-3)?
I20150818-19:52:07.310(-3)? electron-packager@5.0.1 node_modules/electron-packager
I20150818-19:52:07.310(-3)? ├── mv@2.1.1
I20150818-19:52:07.310(-3)? ├── rcedit@0.3.0
I20150818-19:52:07.310(-3)? ├── minimist@1.1.3
I20150818-19:52:07.310(-3)? ├── ncp@2.0.0
I20150818-19:52:07.310(-3)? ├── mkdirp@0.5.1 (minimist@0.0.8)
I20150818-19:52:07.310(-3)? ├── run-series@1.1.2 (dezalgo@1.0.3)
I20150818-19:52:07.311(-3)? ├── asar@0.6.1 (chromium-pickle-js@0.1.0, commander@2.3.0, cuint@0.1.5, glob@5.0.14, minimatch@2.0.4)
I20150818-19:52:07.311(-3)? ├── rimraf@2.4.2 (glob@5.0.14)
I20150818-19:52:07.311(-3)? ├── extract-zip@1.0.3 (debug@0.7.4, minimist@0.1.0, async@0.9.0, mkdirp@0.5.0, yauzl@2.3.1, through2@0.6.3, concat-stream@1.5.0)
I20150818-19:52:07.311(-3)? ├── plist@1.1.0 (util-deprecate@1.0.0, base64-js@0.0.6, xmldom@0.1.19, xmlbuilder@2.2.1)
I20150818-19:52:07.311(-3)? └── electron-download@1.0.7 (path-exists@1.0.0, home-path@0.1.2, debug@2.2.0, nugget@1.5.4)
I20150818-19:52:07.311(-3)?
I20150818-19:52:07.311(-3)? electron-prebuilt@0.29.2 node_modules/electron-prebuilt
I20150818-19:52:07.311(-3)? ├── extract-zip@1.0.3 (debug@0.7.4, minimist@0.1.0, async@0.9.0, mkdirp@0.5.0, yauzl@2.3.1, through2@0.6.3, concat-stream@1.5.0)
I20150818-19:52:07.311(-3)? └── electron-download@1.0.7 (path-exists@1.0.0, home-path@0.1.2, mkdirp@0.5.1, debug@2.2.0, mv@2.1.1, nugget@1.5.4)
I20150818-19:52:07.334(-3)? electrify:  launching electron
=> Started your app.

=> App running at: http://localhost:3000/
ramonitor commented 9 years ago

Hi,

Seemed to be a permissions issue on my .npm folder. I've used the following commands to fix it:

sudo chown -R $USER:$GROUP ~/.npm sudo npm cache clean

Working just fine now. Thanks!

arboleya commented 9 years ago

@ramonitor Very well then. :)

arboleya commented 9 years ago

Just to let you know, I've released a patch where npm is not required. Even when it's installed, Electrify won't use anymore, instead it'll use Meteor's internal npm distribution. :v:

cdechery commented 7 years ago

I'm running the Windows build (downloaded just 10min ago) when I run the app I get this:

image

askz commented 6 years ago

Same error here on linux64