Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Script for Amplify tools can't find node when nvm is used #488

Closed
attilah opened this issue May 26, 2020 · 3 comments
Closed

Run Script for Amplify tools can't find node when nvm is used #488

attilah opened this issue May 26, 2020 · 3 comments
Labels
bug Something isn't working build Issues related to build and CI/CD dev tools Issues related to developer tools
Milestone

Comments

@attilah
Copy link

attilah commented May 26, 2020

Describe the bug
Following the Todo guide when I try to build the project, the Run Script phase fails with the error:

env: node: Not a directory
warning: Node is not installed. Vist https://nodejs.org/en/download/ to install it
Command PhaseScriptExecution failed with a nonzero exit code

I'm using node through nvm and does work from sh, bash, zsh, but not from xcode script.

I even tried to add this to the script, but did not help:

export PATH="$PATH:/Users/<user>/.nvm/versions/node/v13.12.0/bin/node"
@palpatim palpatim added bug Something isn't working build Issues related to build and CI/CD labels May 27, 2020
@drochetti
Copy link
Contributor

A temporary mitigation for this issue is to prepend to your Amplify Build Phase Script the NVM initialization: . ~/.nvm/nvm.sh;

A complete example of the Build Phase script:

. ~/.nvm/nvm.sh;
${PODS_ROOT}/AmplifyTools/amplify-tools.sh;

@drochetti drochetti added the dev tools Issues related to developer tools label Jun 24, 2020
@drochetti drochetti added this to the 1.0.2 milestone Jun 24, 2020
@drochetti
Copy link
Contributor

This was fixed as part of 1.0.2. Please re-open if you're still experiencing the same issue.

@roxberry
Copy link

Started on Xcode 12 beta 6, adding . ~/.nvm/nvm.sh; resolves it. Using amplify 4.29.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Issues related to build and CI/CD dev tools Issues related to developer tools
Projects
None yet
Development

No branches or pull requests

4 participants