Skip to content
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

Cannot find module '../../package.json' #4

Open
arnthorsnaer opened this issue Feb 2, 2015 · 8 comments
Open

Cannot find module '../../package.json' #4

arnthorsnaer opened this issue Feb 2, 2015 · 8 comments

Comments

@arnthorsnaer
Copy link

Hi there

When I try to add some of the required dependancies, while located at the project root, I get an error about problem finding package.json, it seems to be expecting it in the project root but it is not there.

Am I missing something?

...
Fetching plugin "https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git" via git clone
Running command: /Users/arnthorsnaer/Documents/PushNotificationSample/hooks/after_plugin_add/010_register_plugin.js /Users/arnthorsnaer/Documents/PushNotificationSample

module.js:340
    throw err;
          ^
Error: Cannot find module '../../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 Object.<anonymous> (/Users/arnthorsnaer/Documents/PushNotificationSample/hooks/after_plugin_add/010_register_plugin.js:7:19)
    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 Function.Module.runMain (module.js:497:10)
Error: Hook failed with error code 8: /Users/arnthorsnaer/Documents/PushNotificationSample/hooks/after_plugin_add/010_register_plugin.js
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:194:23
    at _rejected (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:797:24)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:823:30
    at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1035:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:741:41)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

@arnthorsnaer
Copy link
Author

A simple workaround is to create a package.json file in the project root. I'll keep this issue open since you'll probably want to drop in a basic package.json file into this project or edit the README.

@yanniboi
Copy link

yanniboi commented Feb 8, 2015

I've had the same problem, @hollyschinsky is the package.json a file you use for personal development that didn't make it into the repo?

@hollyschinsky
Copy link
Owner

Hi guys, I used Ionic to create the basic project which contains a package.json file by default. Are you using Ionic as well?

@arnthorsnaer
Copy link
Author

At least I am. In this instance I did not start with an standard Ionic project though, I started with your sample project. You excluded the package.json when pushing to this repo?

@hollyschinsky
Copy link
Owner

Oh ok, yes, I should have clarified that. I usually recommend creating a starter project with Ionic and then replace the www folder with mine from here.

ionic start myPushApp blank

Then add the dependencies... Then it's not limited to versions of things. Does that make sense?

@arnthorsnaer
Copy link
Author

Yes, makes sense. Thanks :)

@chrisabrams
Copy link

Makes sense - I would recommend adding this to the README :)

@manjurock
Copy link

sudo npm install -g ionic@1.7.16 use this version of ionic will solve this issue

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

No branches or pull requests

5 participants