Not able to npm run build on windows

236 views
Skip to first unread message

Clive Warr

unread,
Aug 10, 2023, 10:50:06 AM8/10/23
to Blockly
Hi,

I've been able to build and deploy new blocks with blockly version": "6.20210701.0" on windows, by using the "npm run build" command for my javascript block and generator files. But having returned to the project and updating to blockly 10.0.2 build.

The latest standard blockly npm down load didn't allow builds as its package.json file didn't seem to cater for scripts (build etc) and the directory structure was incomplete (no block or generator directories etc !!  So I've downloaded the blockly developer zip version from github and I'm getting the following build error on "npm run build":

> blo...@10.0.2 build
> gulp build

fs.js:43
} = primordials;
    ^
ReferenceError: primordials is not defined
    at fs.js:43:5
    at req_ (C:\Users\clive\Desktop\blockly july 2023\blockly-develop(2)\blockly-develop\node_modules\natives\index.js:143:24)
    at Object.req [as require] (C:\Users\clive\Desktop\blockly july 2023\blockly-develop(2)\blockly-develop\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (C:\Users\clive\Desktop\blockly july 2023\blockly-develop(2)\blockly-develop\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)

Node.js v18.17.0 

Any pointers/ assistance appreciated.
Thanks
Clive

Beka Westberg

unread,
Aug 10, 2023, 11:55:00 AM8/10/23
to blo...@googlegroups.com
Hello Clive!

With newer versions of Blockly you don't need to build it yourself! You can import the library from NPM, and then import your blocks + generators separately, and it will all work nicely together =) You can check out our article on unforking for some more information.

If you have any specific questions I'm happy to help!
--Beka

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/3d584cdb-1e38-47d9-a879-68465f925565n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages