Forum - AEK: Cannot deploy package

Tagged: 

  • This topic has 15 replies, 2 voices, and was last updated 6 months ago by Sean Hickman.
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #73545
    David Robinson
    Participant

    Following up on the thread I hijacked (https://developers.exlibrisgroup.com/forums/topic/unable-to-load-aek-examples-or-create-a-new-project/)

    I have the AEK environment working now. I can install and run AEK projects.

    However when I try aek deploy -n, I get an error:
    Error: TypeError: Cannoy read property ‘substring’ of undefined

    The project is saved and git committed. I’m using Node 11.0 as recommended. Do I need a different version to facilitate deployment?

    #73547
    Sean Hickman
    Participant

    Hi David,

    You should be using Node 10 (any version, latest is usually best). If it helps, I updated the article I linked in the other thread a couple of days ago to show how to keep using Node 10 for all AEK commands.

    You’ll need to completely delete node_modules for your project and run aek install again once you’ve sorted your Node version.

    Thanks,

    #73549
    David Robinson
    Participant

    Hi Sean,

    I did have AEK installed but now that’s not working anymore. I deleted node_modules and ran aek install again with the following results:

    `
    $ nvm use 10.24.1
    Now using node v10.24.1 (64-bit)

    $ aek install –ignore-engines
    Error: TypeError: Cannot read propert y ‘substring’ of undefined
    `

    `
    $ node -v
    v12.22.5

    $ aek install
    Error: TypeError: Cannot read propert y ‘substring’ of undefined
    `

    The full error:

    `
    $ aek install
    Error: TypeError: Cannot read propert y ‘substring’ of undefined

    – index.js:55 Interface.rl._getCursorPos
    [npm]/[aek-cli]/[readline2]/index.js:55:52

    – screen-manager.js:19 module.exports.ScreenManager.render
    [npm]/[aek-cli]/[inquirer]/lib/utils/screen-manager.js:19 :27

    – input.js:75 Prompt.render
    [npm]/[aek-cli]/[inquirer]/lib/prompts/input.js:75:15
    – input.js:49 Prompt._run
    [npm]/[aek-cli]/[inquirer]/lib/prompts/input.js:49:8

    – base.js:57 P rompt.run
    [npm]/[aek-cli]/[inquirer]/lib/prompts/base.js:57:8

    – prompt.js:83 0m mObject.<anonymous>
    [npm]/[aek-cli]/[inquirer]/lib/ui/prompt.js:83:12

    – index.js:15 module.exports
    [npm]/[aek-cli]/[run-async]/index.js:15:21

    – utils.js:16
    [npm]/[aek-cli]/[inquirer]/lib/utils/utils.js:16:7

    – rx.lite.js:537 0m 37mtryCatcher
    [npm]/[aek-cli]/[rx-lite]/rx.lite.js:537:29

    – rx.lite.js:5380 [37msetDisposable
    [npm]/[aek-cli]/[rx-lite]/rx.lite.js:5380:36
    `

    I’m sure I installed OK on node 11.0.0 previously so I’m not sure why it would be giving me problems now!

    #73554
    Sean Hickman
    Participant

    It looks like an issue running the AEK CLI. I recommend completely uninstalling it and installing it again under Node 10. The install might have gone through with no problems, but installing it under a different version of Node than intended can mess with the dependencies we rely on.

    I couldn’t get the instructions to paste here for some reason, so I’ve made a blog post about it: https://developers.exlibrisgroup.com/blog/reinstalling-the-aek-cli/

    #73556
    David Robinson
    Participant

    Thanks Sean. I ran through the reinstall under node 10.24.1 but I’m still getting the same error when I try aek install.

    Could the error be to do with something else? I deleted node_modules before attempting aek install.

    Please note that after running the two uninstall commands, when I ran aek at that point (before reinstalling) I got the same error as above, rather than what I’d expect to be aek: command not found, even in a new terminal.

    #73559
    Sean Hickman
    Participant

    Looking closer at the error, it looks like nvm-for-windows might be acting up? Unless the logs are from separate sessions, you set the Node version to 10.24.1, and when you later check the version, it comes up as 12.22.5.

    The problem we have with AEK, Yarn, Node, and nvm is that while both Yarn and Node are successfully managed by nvm (one Yarn installation per Node installation), Yarn installs its global packages to a single folder, completely outside of that context. So your AEK version will always be the same on any version of Node you have. This doesn’t normally cause problems as we only recommend nvm to manage things like needing Node for other frameworks (say you’re learning React Native), or to troubleshoot the AEK specifically.

    But it does sound like here the AEK CLI isn’t being uninstalled correctly. Can you run the uninstall / reinstall instructions again, but before you start reinstalling the AEK CLI, go to:

    [root]\Users\[youruser]\AppData\Local\Yarn\Data\global\node_modules\@ombiel

    And delete any folders there. I also recommend checking the package.json one folder up to make sure that @ombiel/aek-cli is no longer listed in it.

    If there were folders, after deleting them, then test aek to see if it no longer works (as intended, rather than erroring out).

    • This reply was modified 6 months ago by Sean Hickman.
    #73561
    David Robinson
    Participant

    I followed these instructions, and after the two uninstall commands, there wasn’t a `@ombiel’ directory in that path; however I do have this:

    [root]\Users\[youruser]\AppData\Roaming\npm\node_modules\@ombiel\aek-cli

    This directory is persisting after running npm uninstall -g @ombiel/aek-cli

    After removing that directory, when I run aek I don’t get command not found – rather I get a new error:

    $ aek
    internal/modules/cjs/loader.js:638
        throw err;
        ^
    
    Error: Cannot find module 'C:\Users\david\AppData\Roaming\npm\node_modules\@ombiel\aek-cli\run.js'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)
        at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

    I then removed all versions of NPM except 12.22.5 and 10.24.1 but I get the same message when trying to run aek.

    At this point I attempted a reinstall, continuing on from the instructions, which all appeared fine – but when I run aek now I again get the same message as above.

    Looks like I need to wipe something out entirely but I’m not sure what – do you have any suggestions?

    #73562
    Sean Hickman
    Participant

    If you’re using nvm, you shouldn’t have an npm folder at all in %APPDATA% (Roaming). This probably persisted from before you installed and got setup with nvm-for-windows.

    The only two folders (relevant to npm) you should have in Roaming are nvm and npm-cache. Can you try completely removing the whole npm folder?

    #73563
    David Robinson
    Participant

    I’ve uninstalled all existing versions of node and reinstalled just the latest 10 and 12 versions as per the guide.
    All the rest of the commands appear to run, but aek doesn’t seem to be getting installed – command not found. The directories exist, entries are in the PATH but it won’t run in the terminal under either version.

    Attempting installation gives me this:

    $ yarn global add https://npm.campusm.net/get/aek-cli
    yarn global v1.22.19
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    success Installed "@ombiel/aek-cli@1.0.7" with binaries:
          - aek
    Done in 4.23s.

    I’m brought right back to this error:

    $ aek -v
      Error: TypeError: Cannot read propert  y 'substring' of undefined
    
        - index.js:55   Interface.rl._getCursorPos
          [global]/[readline2]/index.js:55:52
    
        - screen-manager.js:19   module.exports.ScreenManager.render
          [global]/[inquirer]/lib/utils/screen-manager.js:19:27
        - list.js:102   Prompt.render
          [global]/[inquirer]/lib/prompts/list.js:102:15
    
        - list.js:73 P  rompt._run
          [global]/[inquirer]/lib/prompts/list.js:73:8
    
        - base.js:57 P  rompt.run
          [global]/[inquirer]/lib/prompts/base.js:57:8
    
        - prompt.js:83 0m  mObject.<anonymous>
          [global]/[inquirer]/lib/ui/prompt.js:83:12
    
        - index.js:15   module.exports
          [global]/[run-async]/index.js:15:21
    
        - utils.js:16
          [global]/[inquirer]/lib/utils/utils.js:16:7
    
        - rx.lite.js:537 0m  37mtryCatcher
          [global]/[rx-lite]/rx.lite.js:537:29
    
        - rx.lite.js:5380 ←  [37msetDisposable
          [global]/[rx-lite]/rx.lite.js:5380:36

    This happens in Node 12.22.5 and 10.24.1. There’s no AppData/Local/npm folder anymore.

    Could there be some other config going wrong?

    #73564
    Sean Hickman
    Participant

    If aek gives you the command not found error, then the last thing you should need to do is associate Yarn with your system path. See “Windows users” on the original blog post for installing the AEK – https://developers.exlibrisgroup.com/blog/installing-aek-2-in-2021/, under Node 10.

    aek should then return a list of commands. For the record, it’s aek --version to get the version – -v isn’t recognised by the CLI.

    If this doesn’t work, I recommend submitting a support ticket so we can look at dedicating some time to going over your setup more directly.

    • This reply was modified 6 months ago by Sean Hickman.
    #73566
    David Robinson
    Participant

    It’s all associated in the path – I hadn’t appreciated -v isn’t recognised.

    $ aek --version
    {
      "aek-cli-support": "1.1.1",
      "aek-cli": "1.0.7"
    }
    $ aek install
      Error: TypeError: Cannot read propert  y 'substring' of undefined
    
        - index.js:55   Interface.rl._getCursorPos
          [global]/[readline2]/index.js:55:52
          ....

    Feels like I’m back to square 1!

    #73567
    Sean Hickman
    Participant

    Bit of a random question – what terminal software are you using? Are you using Git Bash (or another bash shell like Cygwin)? If so, I can only recommend PowerShell / cmd (if you have the new Terminal app on Windows, that wraps PowerShell by default).

    There’s a low-level issue with Git Bash on Windows that affects the AEK CLI (and more besides – https://github.com/SBoudrias/Inquirer.js/issues/272) – I haven’t come across it in a long time, but checking up on that rx-lite error stack brought me back to it.

    • This reply was modified 6 months ago by Sean Hickman.
    • This reply was modified 6 months ago by Sean Hickman.
    • This reply was modified 6 months ago by Sean Hickman.
    #73571
    David Robinson
    Participant

    You cracked it – I am indeed using git bash. Running aek install in cmd instead does work – as does aek deploy -n. Wonderful.

    However!

    aek start no longer works:

    $ aek start
    /usr/bin/bash: Files\Git\bin\bash.exe: No such file or directory
    error: Exit code 127

    Why would the command be looking for bash?

    #73572
    Sean Hickman
    Participant

    It looks like Bash is still being invoked somehow. I’m not sure what would fix this in your environment but this comment (and the issue as a whole) might help – https://github.com/yarnpkg/yarn/issues/5717#issuecomment-545681595, if it’s something in your npm or yarn config.

    If you’ve edited the start script in the project’s package.json, that could be a reason as well (if you were tweaking it maybe to get past the earlier problems).

    • This reply was modified 6 months ago by Sean Hickman.
    #73574
    David Robinson
    Participant

    Perfect – removing the assigned shells using npm config delete script-shell and yarn config delete script-shell has allowed aek-start to run using cmd.

    Thanks so much for your help! Very much appreciated. Now we can both get back to work! 😀

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.