Coursera Training: API Design and Fundamentals of Google Cloud's Apigee API Platform: Week 1: First (Setup) Lab faild

Trying to finish the first lab of the training results in the following error

C:\Users\mswin\Documents\Axel\ApiGee\setup\setup>node setup
C:\Users\mswin\Documents\Axel\ApiGee\setup\setup\setup.js:95
  mvn.execute(['clean', 'install'], mvnArgs).then(() => {
                                                   ^
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Why I'm not prompted to enter the required data?

I use the following version of node.js

v0.12.2

It make no difference if I installed it via msi installer or download it as a zip file and add the folder to my PATH variable

Running npm install results in the following output

C:\Users\mswin\Documents\Axel\ApiGee\setup\setup>npm install
npm WARN package.json backend-setup@1.0.0 No repository field.
npm WARN engine maven@4.4.1: wanted: {"node":">=4.0.0"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine chalk@2.4.2: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine ansi-styles@3.2.1: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine supports-color@5.5.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine has-flag@3.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine find-up@3.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine get-caller-file@2.0.5: wanted: {"node":"6.* || 8.* || >= 10.*"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine string-width@3.1.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine os-locale@3.1.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine is-fullwidth-code-point@2.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine strip-ansi@5.2.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine locate-path@3.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine mem@4.2.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine execa@1.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine lcid@2.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine strip-ansi@4.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine string-width@2.1.1: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine is-fullwidth-code-point@2.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine path-exists@3.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-locate@3.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine invert-kv@2.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine ansi-regex@3.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine ansi-regex@4.1.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine camelcase@5.2.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine map-age-cleaner@0.1.3: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine mimic-fn@2.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-is-promise@2.0.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine cross-spawn@6.0.5: wanted: {"node":">=4.8"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-finally@1.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine get-stream@4.1.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine npm-run-path@2.0.2: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-limit@2.2.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine path-key@2.0.1: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-defer@1.0.0: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine path-key@2.0.1: wanted: {"node":">=4"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine p-try@2.1.0: wanted: {"node":">=6"} (current: {"node":"0.12.2","npm":"2.7.4"})
maven@4.4.1 node_modules\maven


prompt@1.0.0 node_modules\prompt
├── pkginfo@0.4.1
├── revalidator@0.1.8
├── read@1.0.7 (mute-stream@0.0.8)
├── colors@1.3.3
├── utile@0.3.0 (deep-equal@0.2.2, ncp@1.0.1, i@0.3.6, async@0.9.2, mkdirp@0.5.1, rimraf@2.6.3)
└── winston@2.1.1 (cycle@1.0.3, stack-trace@0.0.10, eyes@0.1.8, isstream@0.1.2, pkginfo@0.3.1, async@1.0.0, colors@1.0.3)


replace-in-file@3.4.4 node_modules\replace-in-file
├── chalk@2.4.2 (escape-string-regexp@1.0.5, supports-color@5.5.0, ansi-styles@3.2.1)
├── glob@7.1.3 (path-is-absolute@1.0.1, inherits@2.0.3, fs.realpath@1.0.0, once@1.4.0, inflight@1.0.6, minimatch@3.0.4)
└── yargs@13.2.2 (require-main-filename@2.0.0, which-module@2.0.0, set-blocking@2.0.0, get-caller-file@2.0.5, y18n@4.0.0, require-directory@2.1.1, string-width@3.1.0, yargs-parser@13.0.0, cliui@4.1.0, find-up@3.0.0, os-locale@3.1.0)


I use the following maven version

C:\Users\mswin\Documents\Axel\ApiGee\setup\setup>mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: C:\Users\Public\maven\apache-maven-3.6.0\bin\..
Java version: 9.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-9.0.1
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

How can I fix this? I want to learn to design API and don't want to waste time with config issues.

0 1 183
1 REPLY 1

Hi @Axel Burkhardt

It looks like your version of node.js is not recent enough. You are running 0.12.2, but the error messages show that at least 6.0.0 is required. The setup script won't run successfully until you get a later version installed.

I'd recommend looking into https://github.com/coreybutler/nvm-windows, which allows you to install and select from multiple versions of node in Windows.