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

node build -all on Windows 11: 'Command failed: grunt' #30

Open
serg0307 opened this issue Nov 22, 2024 · 12 comments
Open

node build -all on Windows 11: 'Command failed: grunt' #30

serg0307 opened this issue Nov 22, 2024 · 12 comments

Comments

@serg0307
Copy link

serg0307 commented Nov 22, 2024

Hello, my new friends.
I get an error while running node build --all:

Fetching EspoCRM repository...
  Downloading EspoCRM archive from Github...
  Unzipping...
Installing EspoCRM instance...
  Creating config...
  Npm install...
  Building...
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: grunt
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at buildEspo (file:///D:/work/FORT/extentions/fort2/node_modules/espo-extension-tools/build.js:284:8)
    at file:///D:/work/FORT/extentions/fort2/node_modules/espo-extension-tools/build.js:205:9
    at new Promise (<anonymous>)
    at install (file:///D:/work/FORT/extentions/fort2/node_modules/espo-extension-tools/build.js:199:12)
    at file:///D:/work/FORT/extentions/fort2/node_modules/espo-extension-tools/build.js:28:25 {
  status: 3,
  signal: null,
  output: [ null, null, Buffer(0) [Uint8Array] [] ],
  pid: 21700,
  stdout: null,
  stderr: Buffer(0) [Uint8Array] []
}

Node.js v20.14.0

Steps to recreate:

  1. git clone https://github.com/espocrm/ext-template
  2. Create config.json by copying config-default.json
  3. Create config.php with text
    <?php return [ 'useCacheInDeveloperMode' => true, ];
  4. Run node build -all

I run Win11, grunt is installed (double checked).
Any ideas where I should look at?
Thanks in advance.

@arkadiyasuratov
Copy link
Contributor

Just out of curiosity, if you open node_modules/espo-extension-tools/build.js and change this line:

cp.execSync("grunt internal", {cwd: cwd + '/site', stdio: ['ignore', 'ignore', 'pipe']});

to:

cp.execSync("npx grunt internal", {cwd: cwd + '/site', stdio: ['ignore', 'ignore', 'pipe']});

Does it work?

@yurikuzn
Copy link
Collaborator

yurikuzn commented Nov 22, 2024

Try cd site and run grunt manually. Just to figure out why it does not run.

@serg0307
Copy link
Author

Thanks for such a quick reaction. npx grunt internal worked.

@arkadiyasuratov
Copy link
Contributor

I vote +1 to change it in the upstream. I find npx much more consistent in my internal tooling. Thoughts?

@yurikuzn
Copy link
Collaborator

Is it a new necessity to run it with npx? It works without npx on Linux and Windows 10 for me.

@yurikuzn
Copy link
Collaborator

yurikuzn commented Nov 22, 2024

Maybe it's because grunt is installed globally in all my environments.

@serg0307
Copy link
Author

It looked like this in my case.

cp.execSync("grunt", {cwd: cwd + '/site', stdio: ['ignore', 'ignore', 'pipe']});

Seems like internal does the trick

@arkadiyasuratov
Copy link
Contributor

Then it might be a different issue, I think you have an outdated package haha

@arkadiyasuratov
Copy link
Contributor

Make sure you have at least "espo-extension-tools": "github:espocrm/extension-tools#0.1.8" in your package.json.

@yurikuzn
Copy link
Collaborator

yurikuzn commented Nov 22, 2024

internal builds only libs and css, skipping other stuff. Maybe problem somewhere with other stuff, e.g. composer or npm.

@serg0307
Copy link
Author

image

@serg0307
Copy link
Author

Then it might be a different issue, I think you have an outdated package haha

True. I found out that current version of espo-extension-tools package is 0.2.0 i manually changed it from 0.1.8 in package-lock.json and it has built with no errors.

Thank you for helping me out, guys.

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

3 participants