[
https://issues.apache.org/jira/browse/CB-14126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16509602#comment-16509602
]
Malte Legenhausen commented on CB-14126:
----------------------------------------
This problem is definitly reproduceable. I have this problem in all my cordova
projects now. For reproduction you simply need to install nodejs via homebrew
which should have version 10.4.0 and try to build for ios.
I create a hook to solve the problem by patching the shellScript to use nodejs
version <10 via nvm. Run the following script as before_build script. It seems
that this hook does not work directly on first build. You need to give it a
second try.
{code:java}
const { ConfigParser } = require('cordova-common');
const sh = require('shelljs');
const nvmWhich = (version) => sh.exec(`
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
nvm which ${version} 2> /dev/null
`).stdout.trim();
// See:
https://issues.apache.org/jira/projects/CB/issues/CB-14126?filter=allopenissues
console.log('Patching ios copy www build step to use a node version <10');
const nodePath = nvmWhich(9) || nvmWhich(8);
if (!nodePath) {
console.error('No node version found. Make sure you have nvm installed via
homebrew and a node version >=8 && <=9');
process.exit(1);
}
const configParser = new ConfigParser('./config.xml');
sh.sed(
'-i',
/shellScript = "[^"]*"/,
`shellScript = "${nodePath} cordova/lib/copy-www-build-step.js"`,
`platforms/ios/${configParser.name()}.xcodeproj/project.pbxproj`
);
{code}
> cordova-ios does not build with node 10.4.0
> -------------------------------------------
>
> Key: CB-14126
> URL: https://issues.apache.org/jira/browse/CB-14126
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-ios
> Affects Versions: 8.0.0, 7.1.0
> Environment: macOS 10.13.5
> Xcode 9.4
> Homebrew 1.6.7-72
> Node 10.4.0
> Reporter: Ronald Ligteringen
> Assignee: Suraj Pindoria
> Priority: Blocker
> Labels: PhaseScriptExecution, cordova, cordova-ios, ios, node
>
> The latest version of Node hangs the building process of cordova-ios during
> the PhaseScriptExecution. Furthermore with this version of Node in Cordova
> 8.0 the command
> cordova requirements
> fails during execution
> FIX: These problems do not arise when using Node 8.11.2 (LTS) instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]