Description:
ionic v1 app does not build
There is an issue with node and the 'internal contextify script' : Assertion `args[1]->IsString()' failed
Steps to Reproduce:
$ ionic cordova build ios
Output:
> ionic-v1 build
ionic-v1[53011]: ../src/node_contextify.cc:635:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
My ionic info:
<paste here>
Other Information:
macOS High Sierra v10.13.5
$ npm -v
6.2.0
$ node -v
v10.7.0
$ ionic -v
CLI 4.0.2
$ cordova -v
8.0.0
@dave-k Have you tried reinstalling dependencies?
I reinstalled node_modules, but the error is still there.
rm -rf node_modules
npm install
Okay, I installed Node 10.7.0 and I also get the error. However, when I do this, the issue is resolved: https://github.com/nodejs/node/issues/20285#issuecomment-387612673
Please try:
rm -rf node_modules
rm package-lock.json
npm cache clean --force
npm install
The issue is resolved, but now I get this error - not sure if it is related or a new issue.
Error: Command failed: xcrun simctl list --json
$ ionic cordova build ios
> ionic-v1 build
[12:49:26] Cannot run sass task: missing in gulpfile.js
> cordova build ios
Running command: /Users/dev/mobileapp/hooks/after_prepare/010_add_platform_class.js /Users/dev/mobileapp
add to body class: platform-ios
(node:62271) UnhandledPromiseRejectionWarning: Error: Command failed: xcrun simctl list --json
dyld: Symbol not found: _SimDeviceBootKeyDisabledJobs
Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
Expected in: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
in /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
at ChildProcess.exithandler (child_process.js:291:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:599:12)
That looks like an issue with Xcode. Make sure it's up to date, and make sure you open it.
npm install natives solved this on my setup:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.2.4
@ionic/v1-toolkit : 1.0.22
System:
NodeJS : v11.6.0 (/usr/local/Cellar/node/11.6.0/bin/node)
npm : 6.9.0
OS : macOS High Sierra
I would not recommend installing that.
The best course of action is to switch to a supported LTS version of Node. If problem persists, try the steps in this comment: https://github.com/ionic-team/ionic-cli/issues/3462#issuecomment-409675597
Most helpful comment
Okay, I installed Node 10.7.0 and I also get the error. However, when I do this, the issue is resolved: https://github.com/nodejs/node/issues/20285#issuecomment-387612673
Please try: