aquasecurity / aquasecurity/cloudsploit

async function auth(token): SyntaxError: Unexpected token function

Open
#230 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
751
Avg merge
11d 9h
Merged PRs (30d)
3

Description

I have configured azure service principal in index.js file. when running node index.js file getting below error. Please help on this.

[root@localhost scans-master]# pwd
/opt/scans-master
[root@localhost scans-master]# node index.js
/opt/scans-master/node_modules/@octokit/auth-token/dist-node/index.js:5
async function auth(token) {
^^^^^^^^

SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/opt/scans-master/node_modules/@octokit/rest/plugins/authentication/index.js:3:29)
[root@localhost scans-master]#

Contributor guide

Open the contributing guide

Research direction

Start with index.js and reproduce the failure by running node index.js, then inspect node_modules/@octokit/auth-token/dist-node/index.js at the async function declaration and the runtime compatibility involved. Done means the command starts without this SyntaxError and reaches the configured authentication flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, javascript, node.js
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.