No gulpfile found

We try to compile @cesiumgs/cesium-analytics ourself.But have a problem. Follow these steps:

  1. entry sdk catalog
  2. run npm install command
  3. run gulp command (this command reported an error:No gulpfile found)
  4. try rename gulpfile.cjs to gulpfile.js and repeat step 3.(get follow error:ReferenceError: require is not defined in ES module scope, you can use import instead
    This file is being treated as an ES module because it has a ‘.js’ file extension and ‘E:\CesiumSDK\package.json’ contains “type”: “module”. To treat it as a CommonJS script, rename it to use the ‘.cjs’ file extension).

SKD Version: Cesium-ion-SDK-1.88

Hi @onpoom,

Thank you for reaching out with your question!

I’d love to learn a little bit more about your development environment. In particular, I
d like to learn more about your use of the gulpfile. Typically when I use Cesium Analytics, I use npm to install my package. This should automatically store the package in a node_modules folder. From here, I am able to import cesium-analytics into my JavaScrip code and use the library.

Best,
Sam

Hi,
Thank for your reply!

We would like to complied the source file by self.In the gulpfile.cjs catalog,i use npm to install package. And use gulp command to package the source code. If the command runs successfully,we can find the package in the build catalog. But gulp command reported No gulpfile found.

SDK Version:Cesium-ion-SDK-1.88
npm version:6.14.13
node version:14.17.1
os:windows

thanks
Best regards

Hi @onpoom,

I recommend following the steps outlined in our CesiumJS quickstart tutorial. This tutorial provides comprehensive instructions for how to get up and running in CesiumJS.

Alternatively, you can simply clone our starter project from GitHub. This will give you a repository that is already configured correctly.

Best,
Sam

This was fixed in Fix gulpfile tasks in release zip, but limit packaged scripts by ggetz · Pull Request #10311 · CesiumGS/cesium · GitHub, which should also carry over to cesium-analytics.

Thanks!
Gabby