acoustic-content-samples / wch-site-application

Source code for the Acoustic Content sample site single page application - Oslo.
Apache License 2.0
6 stars 13 forks source link

Layout creation failing #3

Closed prathamesh13 closed 7 years ago

prathamesh13 commented 7 years ago

I am following the tutorial on Customizing the layouts and components for your site

The layout creation is not working as expected.

After i run the command: npm run create-layout -- --type <content type name>

The content types are fetched properly after providing credentials, but the layout creation fails.

Please find the logs below:

Pull started
Pull complete. Pulled 18 artifacts successfully. See wchtools-cli.log for more information on the operation.
Creating the layout, layout mapping, and the angular component.
D:\Watson_projects\WCH\wch-site-application\node_modules\ibm-wch-sdk-cli\node_modules\ts-simple-ast\dist\manipulation\code\getNewInsertCode.js:5
    const { structures, newCodes, parent, getSeparator, previousFormattingKind,
nextFormattingKind } = opts;
          ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (D:\Watson_projects\WCH\wch-site-application\node_modules\ibm-wch-sdk-cli\node_modules\ts-simple-ast\dist\manipulation\code.js:6:10)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (D:\Watson_projects\WCH\wch-site-application\node_modules\ibm-wch-sdk-cli\node_modules\ts-simple-ast\dist\manipulation.js:7:10)
    at Module._compile (module.js:435:26)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "create-layout" "--" "--type" "BookLaunch"
npm ERR! node v4.2.4
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! wch-site-application@1.0.0 create-layout: `echo Pulling the content typ
es. Enter the user password for your WCH tenant: && wchtools pull -t -I --dir sr
c/wchLayouts && echo Creating the layout, layout mapping, and the angular compon
ent. && ibm-wch-sdk-cli create layout --data src/wchLayouts --src src/app --scss
 --flat "--type" "BookLaunch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the wch-site-application@1.0.0 create-layout script 'echo Pul
ling the content types. Enter the user password for your WCH tenant: && wchtools
 pull -t -I --dir src/wchLayouts && echo Creating the layout, layout mapping, an
d the angular component. && ibm-wch-sdk-cli create layout --data src/wchLayouts
--src src/app --scss --flat "--type" "BookLaunch"'.
npm ERR! This is most likely a problem with the wch-site-application package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     echo Pulling the content types. Enter the user password for your WC
H tenant: && wchtools pull -t -I --dir src/wchLayouts && echo Creating the layou
t, layout mapping, and the angular component. && ibm-wch-sdk-cli create layout -
-data src/wchLayouts --src src/app --scss --flat "--type" "BookLaunch"
npm ERR! You can get their info via:
npm ERR!     npm owner ls wch-site-application
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Watson_projects\WCH\wch-site-application\npm-debug.log
ThomasHurek commented 7 years ago

It looks like the problem might be caused by using an old version of node. We require Node 6 or higher. Can you please retry with Node 6?

mburati commented 7 years ago

Also, I would recommend a recent version of Node6 (eg, 6.11.x) to pick up all security and functional fixes to node. Early 6.x Node had some issues that caused problems for wchtools, but many are using wchtools on 6.10.x and 6.11.x. I will ask the documentation team to fix that tutorial you refer to above that states Node4 or later.

prathamesh13 commented 7 years ago

@ThomasHurek @mburati The issue was resolved by upgrading Node to version 6 ( currently using 6.11.4).