Suitecrm 8 - Issue in installing Developer Environment

Hi, I’m trying to follow the Developer Install Guide, but I have an issue with yarn run build-dev:core

stefano@srv-internal:/var/www/html/x-crm8$ sudo yarn run build-dev:core
yarn run v1.22.19
$ ng build core
Building Angular Package


Building entry point ‘core’

Compiling with Angular sources in Ivy full compilation mode.events.js:377
throw er; // Unhandled ‘error’ event

Error: spawn /var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted ‘error’ event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -13,
code: ‘EACCES’,
syscall: ‘spawn /var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild’,
path: ‘/var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild’,
spawnargs: [ ‘–service=0.12.28’, ‘–ping’ ]
}
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.

Any idea of what could it be?

Hello Raul, that’s a permission error.

I’d suggest installing npm with node version manager.

Hi Darius,

I’ve installed NVM and reinstalled node and npm with it. I’ve also made a fresh copy of suite crm 8 and tried to reinstall it from zero.
Unfortunately, the issue is still there:

root@srv-internal:/var/www/html/x-crm8# yarn run build-dev:core
yarn run v1.22.19
$ ng build core
DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
Your global Angular CLI version (14.1.2) is greater than your local version (12.1.0). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Building Angular Package

------------------------------------------------------------------------------
Building entry point 'core'
------------------------------------------------------------------------------

Compiling with Angular sources in Ivy full compilation mode.events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn /var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -13,
  code: 'EACCES',
  syscall: 'spawn /var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild',
  path: '/var/www/html/x-crm8/node_modules/ng-packagr/node_modules/esbuild/bin/esbuild',
  spawnargs: [ '--service=0.12.28', '--ping' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is the output of ng --version, instead:

Angular CLI: 12.1.0
Node: 14.15.1
Package Manager: yarn 1.22.19
OS: linux x64

Angular: 12.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.6
@angular-devkit/build-angular   12.2.6
@angular-devkit/core            12.1.0
@angular-devkit/schematics      12.1.0
@angular/cdk                    11.2.13
@schematics/angular             12.1.0
ng-packagr                      12.2.1
rxjs                            6.6.7
typescript                      4.3.5
webpack                         5.53.0

I’m running everything as superuser.
Any idea?

Thank you very much

Hi Raul,
I also have the same problem…
were you able to solve it?

Thank you

I had the same error message.
I was running everything on a development docker container as root. So that might be causing the error.
When I did a chmod -R 777 on the SuiteCRM documentroot the error disappeared.

This works as a quick fix on a development environment. But there is probably a better solution. Also don’t forget to restore the original file permissions.

Hello ,
thanks, I changed the permissions as recommended and the building commands work.
If I restore the permissions with the scripts recommended by the guide:

find . -type d -not -perm 2775 -exec chmod 2775 {} \;

find . -type f -not -perm 0644 -exec chmod 0644 {} \;

find . \! -user www-data -exec chown www-data:www-data {} \;

chmod +x bin/console

The problem recurs even with the extension building commands
yarn run build-dev:myExt

root@elinet-crm:/var/www/html/suitecrm# yarn run build:myExt
yarn run v1.22.15
$ ng build myExt --configuration production
⠇ Generating browser application bundles (phase: building)...events.js:377
      throw er; // Unhandled 'error' event
      ^

Error: spawn /var/www/html/suitecrm/node_modules/esbuild/bin/esbuild EACCES
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19)
    at onErrorNT (internal/child_process.js:472:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at runNextTicks (internal/process/task_queues.js:64:3)
    at processImmediate (internal/timers.js:437:9)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:12)
    at onErrorNT (internal/child_process.js:472:16)
    [... lines matching original stack trace ...]
    at processImmediate (internal/timers.js:437:9) {
  errno: -13,
  code: 'EACCES',
  syscall: 'spawn /var/www/html/suitecrm/node_modules/esbuild/bin/esbuild',
  path: '/var/www/html/suitecrm/node_modules/esbuild/bin/esbuild',
  spawnargs: [ '--service=0.12.24', '--ping' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.