Forum - AEK: Cannot deploy package
Tagged: aek deploy
- This topic has 15 replies, 2 voices, and was last updated 6 months ago by Sean Hickman.
- AuthorPosts
- August 3, 2022 at 7:57 am #73545David RobinsonParticipant
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 undefinedThe project is saved and git committed. I’m using Node 11.0 as recommended. Do I need a different version to facilitate deployment?
August 3, 2022 at 9:40 am #73547Sean HickmanParticipantHi 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,
August 4, 2022 at 7:37 am #73549David RobinsonParticipantHi Sean,
I did have AEK installed but now that’s not working anymore. I deleted
node_modules
and ranaek 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!
August 4, 2022 at 8:57 am #73554Sean HickmanParticipantIt 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/
August 4, 2022 at 9:23 am #73556David RobinsonParticipantThanks 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 attemptingaek 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 beaek: command not found
, even in a new terminal.August 4, 2022 at 9:32 am #73559Sean HickmanParticipantLooking 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.
August 4, 2022 at 10:48 am #73561David RobinsonParticipantI 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 getcommand 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?
August 4, 2022 at 10:54 am #73562Sean HickmanParticipantIf 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?
August 4, 2022 at 12:53 pm #73563David RobinsonParticipantI’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?
August 4, 2022 at 12:56 pm #73564Sean HickmanParticipantIf
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’saek --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.
August 4, 2022 at 1:07 pm #73566David RobinsonParticipantIt’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!
August 4, 2022 at 1:11 pm #73567Sean HickmanParticipantBit 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.
August 4, 2022 at 1:28 pm #73571David RobinsonParticipantYou cracked it – I am indeed using git bash. Running
aek install
in cmd instead does work – as doesaek 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?
August 4, 2022 at 1:38 pm #73572Sean HickmanParticipantIt 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.
August 4, 2022 at 1:45 pm #73574David RobinsonParticipantPerfect – removing the assigned shells using
npm config delete script-shell
andyarn config delete script-shell
has allowedaek-start
to run using cmd.Thanks so much for your help! Very much appreciated. Now we can both get back to work! 😀
- AuthorPosts
- You must be logged in to reply to this topic.