Skip to content

TypeError: Cannot read property 'match' of null #1245

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

Closed
jmatsushita opened this issue Nov 25, 2015 · 3 comments
Closed

TypeError: Cannot read property 'match' of null #1245

jmatsushita opened this issue Nov 25, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@jmatsushita
Copy link

On OSX. Using node 4.2.2 (tried various other node versions resulting in the same error). The following error displays after installing nativescript as well as with further runs of tns and aborts them.

TypeError: Cannot read property 'match' of null

This is the error displayed on npm install -g nativescript

> [email protected] postinstall /usr/local/lib/node_modules/nativescript
> node postinstall.js

Cannot read property 'match' of null
Error: Unknown command 'dev-post-install'. Try '$ tns help' for a full list of supported commands.
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:7:23)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:9:16)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

And this is the relevant result of tns doctor --log trace

Exec pod --version 
 stdout:  
 stderr: /bin/sh: pod: command not found

TypeError: Cannot read property 'match' of null
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:535:15)
    at /usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:20:45
    - - - - -
    at SysInfoBase.getCocoapodVersion (/usr/local/lib/node_modules/nativescript/lib/common/sys-info-base.js:134:55)
    at /usr/local/lib/node_modules/nativescript/lib/common/sys-info-base.js:47:41
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/sys-info.js:26:105
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/common/dispatchers.js:21:59
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:534:10)
    at /usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:20:45

Also:

$ tns doctor
Cannot read property 'match' of null
# doctor
┌─────────┬──────────────┐
│ Usage   │ Synopsis     │
│ General │ $ tns doctor │
└─────────┴──────────────┘

Checks your system for configuration problems which might prevent the NativeScript CLI from working properly.

$ tns install
TypeError: Cannot read property 'match' of null

Workaround

Creating a fake /usr/local/bin/pod executable solves the problem and all tnscommand run correctly after that.

@rosen-vladimirov rosen-vladimirov added this to the 1.5.1 milestone Nov 25, 2015
@rosen-vladimirov rosen-vladimirov self-assigned this Nov 25, 2015
@rosen-vladimirov
Copy link
Contributor

Hi @jmatsushita
Thanks for pointing this. Another workaround is to install cocoapods on your machine (sudo gem install cocoapods).

@kagha
Copy link

kagha commented Nov 25, 2015

Simply installing cocoapods as @rosen-vladimirov suggested has worked for me.

@verschuur
Copy link

Just wanted to say that I had the same error after updating to 1.5, and @jmatsushita's workaround did the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants