microsoft / vscode-vsce

VS Code Extension Manager
https://code.visualstudio.com/
Other
793 stars 202 forks source link

unexpected token ? in vsce/out/package.js:136 #653

Closed HotelCalifornia closed 2 years ago

HotelCalifornia commented 2 years ago

in an azure CI pipeline build for our extension we get the following failure when trying to package it:

/opt/hostedtoolcache/node/10.24.1/x64/lib/node_modules/vsce/out/package.js:136
    return (translations ?? [])
                          ^

SyntaxError: Unexpected token ?
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/opt/hostedtoolcache/node/10.24.1/x64/lib/node_modules/vsce/out/main.js:27:19)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

not sure what's going on here

HotelCalifornia commented 2 years ago

never mind, needed to update to node 14

nyxb commented 2 years ago

i have the same error with node 16

xieyezi commented 2 years ago

i have the same error with node 16

Resovle it?

melir91 commented 2 years ago

In my case I installed vsce with Node 12.x.x and then switched to Node 14.x.x

Installed vsce with Node 14.x.x and then the issue was resolved

Rainy934 commented 1 month ago

i have the same error with node 16

Resovle it?

有解决方案吗?