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

Initialization of packages #47

Closed
FlusherDock1 opened this issue Aug 7, 2019 · 11 comments
Closed

Initialization of packages #47

FlusherDock1 opened this issue Aug 7, 2019 · 11 comments

Comments

@FlusherDock1
Copy link

FlusherDock1 commented Aug 7, 2019

Describe the bug
Webpack throwing errors when I'm trying to run npm run watch

To Reproduce
Steps to reproduce the behavior:

  1. Clone or download rep in any folder.
  2. Open the terminal and run npm i
  3. then npm run watch
  4. Get errors because of unknown Gutenberg packages.

Expected behavior
Run npm run watch without errors

Screenshots
One of the erorrs:
Снимок экрана 2019-08-07 в 16 44 11

Environment:

  • Laraberg Version: 1.0.0-rc.1
  • OS: macOS Mojave 10.14.5
  • Browser: –
  • Version: –
@mauricewijnia
Copy link
Member

mauricewijnia commented Aug 7, 2019

You have to link the gutenberg repository through npm.

You can do that by cloning the repository https://github.com/WordPress/gutenberg
To get the packages that laraberg currently uses you have to checkout v6.2.0:
git checkout v6.2.0
Then npm install followed by npm run build and finally npm link

After that the gutenberg packages will be available.

@FlusherDock1
Copy link
Author

FlusherDock1 commented Aug 7, 2019

Thanks for the quick response! But I still get errors...

My steps:

  1. In cloned Laraberg rep. executing git clone https://github.com/WordPress/gutenberg.git gutenberg
  2. then cd gutenberg; git checkout v6.2.0; cd ..
  3. then npm install; npm run build; npm link;

Снимок экрана 2019-08-07 в 17 36 50

Do i need to move gutenberg folder to node_modules folder after npm install?

p.s. Sorry if I'm doing something obvious wrong

@mauricewijnia
Copy link
Member

Ah sorry I forget the last step...
You should run npm link gutenberg in the Laraberg project folder

@FlusherDock1
Copy link
Author

I did everything 3 times to be more precise...

Cloned repo, cloned Gutenberg, executed steps above. and...

Снимок экрана 2019-08-07 в 17 52 10

@mauricewijnia
Copy link
Member

Hmm strange, npm link gutenberg should create a symbolic link to the gutenberg package in your laraberg's node_modules folder, are you seeing that?

@FlusherDock1
Copy link
Author

FlusherDock1 commented Aug 7, 2019

are you seeing that?

Yes, and the arrow represents a symbolic link.

Снимок экрана 2019-08-07 в 17 59 57

@FlusherDock1
Copy link
Author

Tried npm ls gutenberg, and npm ls "random package from package.json"

Снимок экрана 2019-08-07 в 18 03 39

@mauricewijnia
Copy link
Member

mauricewijnia commented Aug 7, 2019

I just cloned laraberg into a new directory and did:
npm install
npm link gutenberg
npm start

And I'm not getting the error you're getting...
So I'm not sure what's going on, but I don't really know how to help you.
My npm version is 6.9.0 and my node.js is version 10.16.0.
Maybe a different version is causing those issues?

Are you sure Gutenberg is building succesfully?

@FlusherDock1
Copy link
Author

FlusherDock1 commented Aug 7, 2019

Are you sure Gutenberg is building successfully?

What do you mean?

And I'm not getting the error you're getting...

I just read all manuals how to link package and after around 10 attempts of reinstalling i tried npm ls gutenberg

And now it's
Снимок экрана 2019-08-07 в 18 50 03

But when I do npm start everything stays the same...

@FlusherDock1
Copy link
Author

God. I just figured all out.

My first steps were wrong, and after your

Are you sure Gutenberg is building successfully?

I left the project for the night, and in the morning I tried everything with a fresh mind.

I did not build Gutenberg. I did not link package inside Gutenberg folder by 'npm link'.

I think you don't have any errors because you already linked Gutenberg in your /../lib/../node_modules, and you can link it to project without building it.

Finalizing all steps to get all work properly:

  1. Clone Laraberg rep.
  2. Clone Gutenberg rep. in Laraberg folder:
    git clone https://github.com/WordPress/gutenberg.git gutenberg
  3. After cloning execute these commands:
    cd gutenberg           // go to Gutenberg folder
    npm i                  // install all dependencies
    npm run build          // Build Gutenberg
    sudo npm link          // Link it to your global node_modules 
    cd ..                  // Go back to Laraberg root
    npm i                  // install all dependencies
    npm link gutenberg     // Link Gutenberg package to Laraberg
  4. Now you can work with Laraberg.

@mauricewijnia
Copy link
Member

mauricewijnia commented Aug 8, 2019

Ah nice!
This is what I meant in my first comment, guess I just wasn't clear enough.
Glad you got it to work :)

Btw you don't have to clone gutenberg in the laraberg folder, anywhere will do as long as your run npm install npm build & npm link in that folder

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

2 participants