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

Error: Cannot find module 'dotenv' #137

Closed
szvest opened this issue Mar 13, 2020 · 1 comment
Closed

Error: Cannot find module 'dotenv' #137

szvest opened this issue Mar 13, 2020 · 1 comment

Comments

@szvest
Copy link

szvest commented Mar 13, 2020

I am trying to scaffold a custom post type with npm run scaffold:cpt <cpt name> command.

I am making sure to set up the .env file in the same main directory as docker-compose.yml as mentioned in the guide. I tried both options :

a) docker-compose down before creating .env manually followed by `docker-compose up -d.

b) using npm run env

However both ways gives me Error: Cannot find module 'dotenv'.

Is there anything I am missing? Thanks.

@szvest
Copy link
Author

szvest commented Mar 13, 2020

Fixed. What was missing is npm install in the root to install dotenv and other dependencies. Now, having cptname.php file created.

This is for anyone who may have gotten into this error.

npm install 
docker-compose up -d
npm run scaffold:cpt <cptname>
WARNING: wp cli not installed, trying auto install ...
SUCCESS: wp cli installed!
done!
SUCCESS: Post type <cptname> created.

@szvest szvest closed this as completed Mar 13, 2020
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

1 participant