Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Cannot find module package.json #47

Closed
raidenz opened this issue Jan 16, 2016 · 3 comments
Closed

Cannot find module package.json #47

raidenz opened this issue Jan 16, 2016 · 3 comments

Comments

@raidenz
Copy link

raidenz commented Jan 16, 2016

i dont know this is error because my version or not, i use
node v4.2.1
npm 3.5.4

i use cygwin to test it
i have problem to start the script
Error: Cannot find module '/cygdrive/g/gulp/gulp-wp-theme/package.json'

i solve this by change var packageConfig = require(process.env.PWD + '/package.json');
to var packageConfig = require('../package.json');

in gulp config-development and config-production

i have question why not change it to
var packageConfig = require('../package.json');
i think its save for other operating system

@renestalder
Copy link
Contributor

What's your project's file structure? Did you install the package via npm or manually downloading it? Do you have a package.json in your projects root folder?

packageConfig = require(process.env.PWD + '/package.json'); ensures that it uses your config and not the config of the gulp-wp-theme package. With your change, this gets useless.

So first ensure you have a package config in the project's root and then check you are running the command out of the root folder.

@raidenz
Copy link
Author

raidenz commented Jan 19, 2016

yes thanks, im doing it wrong. i manually download it.
now i install it from npm and its work
thanks 👍

@renestalder
Copy link
Contributor

Good to hear. Let us know if you have troubles.

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

No branches or pull requests

2 participants