0

I want to build from grapesjs I downloaded @Version 0.21.2

npm install
npm run build

... but I get the following errors:

 FAIL test/specs/asset_manager/view/FileUploader.js
● Test suite failed to run

TypeError: Cannot redefine property: localStorage

  22 | global.$ = global.grapesjs.$;
  23 | global.localStorage = localStorage;
> 24 |
     | ^

  at Object.<anonymous> (test/setup.js:24:21)


FAIL test/specs/asset_manager/view/AssetsView.js
● Test suite failed to run

TypeError: Cannot redefine property: localStorage

  22 | global.$ = global.grapesjs.$;
  23 | global.localStorage = localStorage;
> 24 |
     | ^

  at Object.<anonymous> (test/setup.js:24:21)


and so 75 errors...

Test Suites: 75 failed, 1 passed, 76 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 37.997s
Ran all test suites.

When I execute the builder without the test command, other errors appear:

for (let i = startIndex ?? 0; i < array.length; i++) {
                         ^

SyntaxError: Invalid or unexpected token
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)

Node.js v18.16.0
ERROR: "build:js" exited with 1.

There is also this warning:

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.0.0

YOUR TYPESCRIPT VERSION: 5.1.3

Could the cause of the failure be here?

0 Answers0