Skip to content

ios builds with 2.0.0: Processing node_modules failed. TypeError: Cannot read property 'split' of null #1734

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
georgeedwards opened this issue May 1, 2016 · 7 comments · Fixed by #1748
Assignees
Labels
Milestone

Comments

@georgeedwards
Copy link

georgeedwards commented May 1, 2016

I have just restarted my mac for the first time since I updated to the CLI 2.0.0. My project which was working before now won't build, citing error:

Processing node_modules failed. TypeError: Cannot read property 'split' of null

I am running OSX El Capitan with XCode 7.3

Even if I run npm install nativescript -g I get the same error:

Unknown-88-63-df-a3-2e-e9:demo georgeedwards$ npm install nativescript -g
npm WARN excluding symbolic link docs/stylesheets/hightlight.css -> ../../node_modules/highlight.js/src/styles/solarized_light.css
npm WARN deprecated [email protected]: This package has been discontinued in favor of lodash@^4.0.0.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN excluding symbolic link docs/assets/ir_black.css -> ../../node_modules/highlight.js/src/styles/ir_black.css
npm WARN excluding symbolic link examples/TestFramework/Test Framework.framework/Resources -> Versions/Current/Resources
npm WARN excluding symbolic link examples/TestFramework/Test Framework.framework/Test Framework -> Versions/Current/Test Framework
npm WARN excluding symbolic link examples/TestFramework/Test Framework.framework/Versions/Current -> A
/Users/georgeedwards/.npm-packages/bin/tns -> /Users/georgeedwards/.npm-packages/lib/node_modules/nativescript/bin/nativescript.js
/Users/georgeedwards/.npm-packages/bin/nativescript -> /Users/georgeedwards/.npm-packages/lib/node_modules/nativescript/bin/nativescript.js

> [email protected] postinstall /Users/georgeedwards/.npm-packages/lib/node_modules/nativescript
> node postinstall.js

WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
Cannot read property 'split' of null
Error: Unknown command 'dev-post-install'. Try '$ tns help' for a full list of supported commands.
    at Object.<anonymous> (/Users/georgeedwards/.npm-packages/lib/node_modules/nativescript/lib/common/errors.js:7:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/georgeedwards/.npm-packages/lib/node_modules/nativescript/lib/nativescript-cli.js:8:16)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
/Users/georgeedwards/.npm-packages/lib
└── [email protected] 
@georgeedwards
Copy link
Author

Here is a link to the full failing build stack trace

@TsvetanMilanov
Copy link
Contributor

@georgeedwards check if you have CocoaPods installed. If you have it, tell me which version it is.

@mgol
Copy link

mgol commented May 5, 2016

Installing CocoaPods 0.39.0 resolved it for me but before that I've seen it even in the tns doctor output which shouldn't happen.

@georgeedwards
Copy link
Author

Yes, I had to reinstall Cocoapods (with all the El Capitan and Xcode 7.3 quirks) and it started working again. Not sure why it affected tns doctor

@dtopuzov
Copy link
Contributor

Still valid in master

@ddfreiling
Copy link

ddfreiling commented Jun 3, 2016

I believe this issue is due to the Cocoapods master repo not having been setup.

It happened to me when I changed to a new user account on my Mac, which of course had an empty ~/.cocoapods directory.
At first tns doctor reported that master repo was not setup, but then it stopped reporting it without having actually solved the issue. (Maybe because I didnt run tns doctorwith sudo?)

I fixed it by following the suggestion here: CocoaPods/CocoaPods#4293 (comment)

EDIT: I continued to have this issue until I did a chown on my entire project. Seems I had sudo npm installed some dependencies and "pod install" was failing because of that. If you see this error, the best sanity check is to cd platforms/ios && pod install and see if it works.

@enchev
Copy link
Contributor

enchev commented Jun 9, 2016

Fixed with #1804

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

Successfully merging a pull request may close this issue.

7 participants