CI Fails with : SyntaxError: Use of const in strict mode

%3CLINGO-SUB%20id%3D%22lingo-sub-2142107%22%20slang%3D%22en-US%22%3ECI%20Fails%20with%20%3A%20SyntaxError%3A%20Use%20of%20const%20in%20strict%20mode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2142107%22%20slang%3D%22en-US%22%3E%3CP%3EI%20follow%20the%20steps%20here%20to%20create%20a%20build%20definition%3A%3CSPAN%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Ftoolchain%2Fimplement-ci-cd-with-azure-devops%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Ftoolchain%2Fimplement-ci-cd-with-azure-devops%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Elocally%20I%20have%20Node%2010.23.3%20and%20npm%206.14.11%3C%2FP%3E%3CP%3EHowever%20when%20I%20run%20the%20build%20definition%20I%20get%20several%20errors%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Econst%20envPaths%20%3D%20require('env-paths')%0A%5E%5E%5E%5E%5E%0ASyntaxError%3A%20Use%20of%20const%20in%20strict%20mode.%0A%20%20%20%20at%20Module._compile%20(module.js%3A433%3A25)%0A%20%20%20%20at%20Object.Module._extensions..js%20(module.js%3A468%3A10)%0A%20%20%20%20at%20Module.load%20(module.js%3A350%3A32)%0A%20%20%20%20at%20Function.Module._load%20(module.js%3A306%3A12)%0A%20%20%20%20at%20Function.Module.runMain%20(module.js%3A491%3A10)%0A%20%20%20%20at%20startup%20(node.js%3A119%3A16)%0A%20%20%20%20at%20node.js%3A792%3A3%0ABuild%20failed%0Anpm%20WARN%20optional%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20fsevents%402.3.2%20(node_modules%5Cwatchpack%5Cnode_modules%5Cfsevents)%3A%0Anpm%20WARN%20notsup%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20Unsupported%20platform%20for%20fsevents%402.3.2%3A%20wanted%20%7B%22os%22%3A%22darwin%22%2C%22arch%22%3A%22any%22%7D%20(current%3A%20%7B%22os%22%3A%22win32%22%2C%22arch%22%3A%22x64%22%7D)%0Anpm%20WARN%20optional%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20fsevents%401.2.13%20(node_modules%5Cfsevents)%3A%0Anpm%20WARN%20notsup%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20Unsupported%20platform%20for%20fsevents%401.2.13%3A%20wanted%20%7B%22os%22%3A%22darwin%22%2C%22arch%22%3A%22any%22%7D%20(current%3A%20%7B%22os%22%3A%22win32%22%2C%22arch%22%3A%22x64%22%7D)%0Anpm%20WARN%20optional%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20fsevents%402.3.2%20(node_modules%5Cjest-haste-map%5Cnode_modules%5Cfsevents)%3A%0Anpm%20WARN%20notsup%20SKIPPING%20OPTIONAL%20DEPENDENCY%3A%20Unsupported%20platform%20for%20fsevents%402.3.2%3A%20wanted%20%7B%22os%22%3A%22darwin%22%2C%22arch%22%3A%22any%22%7D%20(current%3A%20%7B%22os%22%3A%22win32%22%2C%22arch%22%3A%22x64%22%7D)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20at%20the%20end%20of%20the%20log%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E54037%20error%20code%20ELIFECYCLE%0A54038%20error%20errno%208%0A54039%20error%20deasync%400.1.21%20install%3A%20%60node%20.%2Fbuild.js%60%0A54039%20error%20Exit%20status%208%0A54040%20error%20Failed%20at%20the%20deasync%400.1.21%20install%20script.%0A54040%20error%20This%20is%20probably%20not%20a%20problem%20with%20npm.%20There%20is%20likely%20additional%20logging%20output%20above.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2142107%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I follow the steps here to create a build definition: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/toolchain/implement-ci-cd-with-azure-devops

locally I have Node 10.23.3 and npm 6.14.11

However when I run the build definition I get several errors

 

const envPaths = require('env-paths')
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:433:25)
    at Object.Module._extensions..js (module.js:468:10)
    at Module.load (module.js:350:32)
    at Function.Module._load (module.js:306:12)
    at Function.Module.runMain (module.js:491:10)
    at startup (node.js:119:16)
    at node.js:792:3
Build failed
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

 

And at the end of the log:

 

54037 error code ELIFECYCLE
54038 error errno 8
54039 error deasync@0.1.21 install: `node ./build.js`
54039 error Exit status 8
54040 error Failed at the deasync@0.1.21 install script.
54040 error This is probably not a problem with npm. There is likely additional logging output above.

 

0 Replies