aquasecurity / aquasecurity/cloudsploit
async function auth(token): SyntaxError: Unexpected token function
- 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
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