We try to compile @cesiumgs/cesium-analytics ourself.But have a problem. Follow these steps:
- entry sdk catalog
- run npm install command
- run gulp command (this command reported an error:No gulpfile found)
- 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
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.
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.
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.